How to redirect a page using JavaScript????

Discussion in 'JavaScript' started by alisha0512, Jul 30, 2008.

  1. #1
    Hi,
    i want to know how a page is redirected using JavaScript?
     
    alisha0512, Jul 30, 2008 IP
  2. vishwaa

    vishwaa Well-Known Member

    Messages:
    271
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #2
    vishwaa, Jul 30, 2008 IP
  3. dshuck

    dshuck Peon

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    document.location.href='whateverpage.html';
     
    dshuck, Jul 30, 2008 IP
  4. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    window.location.url also works.
     
    Sleeping Troll, Jul 30, 2008 IP
  5. alisha0512

    alisha0512 Banned

    Messages:
    345
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5

    where it will be used in javascript?
     
    alisha0512, Jul 31, 2008 IP
  6. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hello
    you can used according to your conditions

    
    <script language="javascript" type="text/javascript"> 
    document.location.href='test.html'
    </script>
    
    Code (markup):
    or

    
    <script language="javascript" type="text/javascript"> 
    window.location.url='test.html'
    </script>
    
    Code (markup):
    both are used for redirection.
     
    VishalVasani, Jul 31, 2008 IP