I have a DIV Called fArea and when i click the open button it's sets fo=2 but the code still refreshs so i tryed to add if and else and now it is not displying anything.
jQuery Code:
function unique_requestid() {
var timestamp = Number(new Date()).toString();
var random = Math.random() * (Math.random() * 100000 * Math.random() );
var unique = new String();
unique = timestamp + random;
return unique;
}
function FriendsContent(id) {
if(id == 2){
var refresh = setInterval(
function() {
$("#fArea").load("friends_online.php?fo="+id+"&random=" +
unique_requestid());
}, 5000
);
} else {
$("#fArea").load("friends_online.php?fo="+id+"&random=" +
unique_requestid());
};
}