Jump to content

JavaScript:Tutorial, Redirect URL

- - - - -

  • Please log in to reply
5 replies to this topic

#1
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Introduction:-
Welcome to another JavaScript tutorial of mine..This will code will Redirect the user to a specified website

Solution:-
This code goes in the <head> tags:-

<SCRIPT language="JavaScript"> 
 function redirUrl()
  {
    top.location="http://forum.codecall.net";
   }
 
   if (top.frames.length==0)
    {
     alert("You will be redirected to forum.codecall.net in 3 seconds!");
     setTimeout('redirUrl()',3000);
     }
</SCRIPT> 

Explanation:-
I think it's self explanatory no need of explanations! Its too simple

A Preview:-
Posted Image

Conclusion:-
As Always Feedback is welcome and the full source is attached!!

Attached Files



#2
xXHalfSliceXx

xXHalfSliceXx

    Speaks fluent binary

  • Moderators
  • 1,694 posts
0_o Not quite custom. I made that script to an intro class in Tech School. I can look that up in my java book here at home...

Good redirector, but you can find that anywhere.

Posted Image
Posted Image


#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well Its simple and can be done by anyone and found anywhere but still.. its a tutorial ;)

#4
-Hurricane-

-Hurricane-

    Newbie

  • Members
  • Pip
  • 9 posts
3 secs.....lol. i dont understand that . explain pls.

#5
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
Its just saying its going to wait 3 seconds:
Many sites do this (especially for billing) so they can tell their customers that they are being transfered to a secure site that is used by them and reasure the customers that its safe. (If a window changed to a site asking for your card number would u blindly put it in).
Theres my $5
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#6
OriginalJesse

OriginalJesse

    Newbie

  • Members
  • Pip
  • 1 posts
Thanks :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users