SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirecting using javascript - help

    Hi,

    How can i redirect to a new page. Is that using
    location.href = 'http://www.mypage.com';?

    But i have a page which is a login page, when the user enter the id and password, it should redirect to the new page.

    Is there any way that i could put the other page(new) in between the login and destination page?

    Before displaying the destination page it should display the intermediatepage.

    Can any one please help me with this?

    Thank you

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,677
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    You can put the destination page in the querystring of the intermediate page, which would read that url then and take you there.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply. The best example i can say is ..same as the sitepoint login page. when we enter the required information its taking us to the appropriate page(the page we came from).Is this possible with the client side javascripting?

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,677
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Yes, that's even easier because the intermediate page is always taking you to the same location.
    http://en.wikipedia.org/wiki/Meta_refresh

    It doesn't require javascript, and is pretty much guaranteed to work.
    To keep people informed about what is going to happen, you should also have link telling people where they're going to be redirected off to.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •