Yep, here I borrow you so many, many tutorial that are useful but.. simple. The tutorial about how to use the code was in the console I write. You can see the tutorial by checking at your console.. here, I provide some $.getScript(); method that are SAFE. I'm NOT INJECTING, like injecting ads and make it as my money making machine or whatever it called. So please, don't listen to peoples who believes that I'm foul-playing, there's no prove though. And I'm not cheating. And.. guess what? YES! The script was hosted in this forum (LOLWesta) since I'm a coder here. Lol. The webmaster & admin lets me to create some script before sending it to them. Webmaster and administrator will checks if the code was extra-secure or can hacks some database or some ads in here. Don't worry, I don't cheat!
CHATBOX STYLING
if(document.activeElement == iframe) will run something if the user was active in the iframe, in this case we call this iframe 'chatbox'. So if the user enters the chatbox, the alert will come.
}else{ will run something if the user was not in the chatbox. In this example I'll do return false that will do nothing, as far as I known.
CHECKING ROLE (MEMBER OR NOT) - thanks to sugar
var o = document.getElementById don't do anything in here. It will GET the logout link.
if(o!=null) it will run something if the script founds logout, or if value of variable o was not equal to NULL. It means that, you are MEMBER! YAY!
}else{ this is the same like my script above. It'll do something if your status are GUEST, or technically we can call the value of variable o was NULL or equal to 0.
2015-01-03 - 10:59:11 - Removed the comments for every code since it'll will turn some error . Put the explanations .
CHATBOX STYLING
- Code:
$.getScript('http://lolwesta.forumotion.com/22342.js');
if(document.activeElement == iframe) {
alert('Welcome to Tsu Chatbox');
}else{
return false;
}
if(document.activeElement == iframe) will run something if the user was active in the iframe, in this case we call this iframe 'chatbox'. So if the user enters the chatbox, the alert will come.
}else{ will run something if the user was not in the chatbox. In this example I'll do return false that will do nothing, as far as I known.
CHECKING ROLE (MEMBER OR NOT) - thanks to sugar
- Code:
var o = document.getElementById('logout');
if(o!=null) {
console.log('You are member');
}else{
console.log('You are guest');
}
var o = document.getElementById don't do anything in here. It will GET the logout link.
if(o!=null) it will run something if the script founds logout, or if value of variable o was not equal to NULL. It means that, you are MEMBER! YAY!
}else{ this is the same like my script above. It'll do something if your status are GUEST, or technically we can call the value of variable o was NULL or equal to 0.
2015-01-03 - 10:59:11 - Removed the comments for every code since it'll will turn some error . Put the explanations .
Last edited by Tsu on Sat Jan 03, 2015 2:59 am; edited 1 time in total