ei this is a double post, another trick like this is already posted last year.
by the way..
[quote]var myplace = document.location.href;
if (myplace == "http://profiles.friendster.com/user.php?uid=USERID"){
}
[color=red]else if (myplace == "http://profiles.friendster.com/user.php?uid=USERID"){
}[/color]
else {
location.href = "http://whatever.html";
}[/quote]
not a good programming practice, just delete the red part
because its condition statement is just the same in the first [b]if[/b] statement
or just make it simple like this:
[quote]var myplace = document.location.href;
if (myplace != "http://profiles.friendster.com/user.php?uid=USERID"){
location.href = "http://whatever.html";
}[/quote]
or like this:
[quote]var myplace = document.location.href;
if (myplace == "http://profiles.friendster.com/user.php?uid=USERID"){
[color=red][i]your full javascript codes here...[/i]
[i]your full javascript codes here...[/i]
[i]your full javascript codes here...[/i]
[i]your full javascript codes here...[/i][/color]
}
else{
location.href = "http://whatever.html";
}[/quote]
notice the difference
the output is the same but the code i made is much faster than the other one
its also a good practice to optimize your codes for better performance..
by the way tnx
Last edited by myparis (2008-02-29 01:07:44)