redirect via javascript

Discussion in 'Javascript' started by Lee David, Jun 4, 2005.

  1. Lee David

    Lee David Guest

    I want to redirect anyone going to one site to another site. I have a
    "windows.open" on the original site and that opens a new browser, but what I
    want it the old one to be replaced (or at least go way once they are
    redirected).

    How do I do this?

    TIA,
    Lee
     
    Lee David, Jun 4, 2005
    #1
    1. Advertising

  2. Lee David

    VK Guest

    document.location.href = newURL;
     
    VK, Jun 4, 2005
    #2
    1. Advertising

  3. On 04/06/2005 17:51, Lee David wrote:

    > I want to redirect anyone going to one site to another site.


    Then use a server-side redirect. It's reliable, friendly to all user
    agents, and doesn't break the Back button.

    See <URL:http://www.w3.org/QA/Tips/reback>.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Jun 4, 2005
    #3
  4. Lee David

    Lee David Guest

    Unfortunately, that didn't work.

    I appreciate the response, however.

    Lee

    "VK" <> wrote in message
    news:...
    > document.location.href = newURL;
    >
     
    Lee David, Jun 5, 2005
    #4
  5. Lee David

    Lee David Guest

    Thank you, that worked. Unfortunately, the cite gave an example of what not
    to do, but none of what to do. But I made an assumption and it seemed to
    work.

    BTW, I couldn't find it in 'JavaScript The Definitive Guide' by O'Reilly. I
    really to try to find the answer before I ask the question. Neither the
    "redirect" nor the "refresh" were in the definitive guide.<g>

    Lee

    "Michael Winter" <> wrote in message
    news:Dvmoe.45307$...
    > On 04/06/2005 17:51, Lee David wrote:
    >
    >> I want to redirect anyone going to one site to another site.

    >
    > Then use a server-side redirect. It's reliable, friendly to all user
    > agents, and doesn't break the Back button.
    >
    > See <URL:http://www.w3.org/QA/Tips/reback>.
    >
    > [snip]
    >
    > Mike
    >
    > --
    > Michael Winter
    > Replace ".invalid" with ".uk" to reply by e-mail.
     
    Lee David, Jun 5, 2005
    #5
  6. On 05/06/2005 02:58, Lee David wrote:

    [MW:]
    >> See <URL:http://www.w3.org/QA/Tips/reback>.

    >
    > Thank you, that worked. Unfortunately, the cite gave an example of what not
    > to do, but none of what to do.


    It provides links to other documents that describe how to implement
    server-side redirects for a selection of systems.

    Mike


    In future, please do not top-post.
    <URL:http://www.faqs.org/docs/jargon/T/top-post.html>

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Jun 5, 2005
    #6
  7. Lee David

    Art X Guest

    Would this work ?

    window.location.replace("newpage.html");

    Might help eliminate some of that back button abuse.

    Later, Art.
     
    Art X, Jun 6, 2005
    #7
  8. VK wrote:

    > document.location.href = newURL;


    You have already read that `document.location' is deprecated long since.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Jun 16, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,358
    Srowe1975
    Oct 15, 2008
  2. CK

    Redirect via web.config

    CK, Jul 11, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    656
    Alvin Bruney [MVP]
    Jul 11, 2006
  3. Sal
    Replies:
    1
    Views:
    994
  4. Ron Howard
    Replies:
    2
    Views:
    575
    Ron Howard
    Aug 11, 2004
  5. Replies:
    4
    Views:
    333
    Bob Barrows [MVP]
    Sep 22, 2006
Loading...

Share This Page