SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member manapkt's Avatar
    Join Date
    May 2003
    Location
    McAllen, TX
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript redirect

    I have an agreement page that has 2 buttons at the bottom (Accept & Decline). When a user clicks accept it takes them to a login page, if they click decline I want to redirect them to another page. Here is where things get intresting, I don't want to send them to just any page (I know how to do that) I want to redirect them to whatever page they have set as their homepage in their browser. Is there any way to do this? any help would be greatly appreciated. Thank you

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2003
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if the homepage of their browser is blank?

  3. #3
    SitePoint Member manapkt's Avatar
    Join Date
    May 2003
    Location
    McAllen, TX
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe that the default is "about:blank", so that would take them to a blank page and that is fine by me.

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>homie</title>
    </head>
    <body>
    <form>
    <h4 style="display:inline;margin-right:20px;">Do you agree, you little weasel?</h4>
    <input type="button" value="Accept" onclick="top.location='javascript&#58;alert(\'login.html\')'">
    <input type="button" value="Decline" onclick="if(window.home)window.home();else top.location='about&#58;home'">
    </form>
    </body>
    </html>
    ::: certified wild guess :::

  5. #5
    SitePoint Member manapkt's Avatar
    Join Date
    May 2003
    Location
    McAllen, TX
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adios
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>homie</title>
    </head>
    <body>
    <form>
    <h4 style="display:inline;margin-right:20px;">Do you agree, you little weasel?</h4>
    <input type="button" value="Accept" onclick="top.location='javascript:alert(\'login.html\')'">
    <input type="button" value="Decline" onclick="if(window.home)window.home();else top.location='about:home'">
    </form>
    </body>
    </html>
    Thanks Adios, I knew of the "about:blank" but didn't know about "about:home". Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •