473,388 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

redirect via javascript

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
Jul 23 '05 #1
7 2854
VK
document.location.href = newURL;

Jul 23 '05 #2
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.
Jul 23 '05 #3
Unfortunately, that didn't work.

I appreciate the response, however.

Lee

"VK" <sc**********@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
document.location.href = newURL;

Jul 23 '05 #4
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" <m.******@blueyonder.co.invalid> wrote in message
news:Dv******************@text.news.blueyonder.co. uk...
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.

Jul 23 '05 #5
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.
Jul 23 '05 #6
Would this work ?

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

Might help eliminate some of that back button abuse.

Later, Art.

Jul 23 '05 #7
VK wrote:
document.location.href = newURL;


You have already read that `document.location' is deprecated long since.
PointedEars
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID:...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
1
by: Ryann | last post by:
I hate javascript looking for help. I am trying to pass hidden fields around without showing a query string in the address bar. e.g. formA.asp not formA.asp?var1=blah&var2=blah I have...
4
by: Van Duijn | last post by:
I use an inlineframe to display pages with images with javascript pop up links. These image pages redirect to each other with the trusted <meta http-equiv="refresh" content="10; url=vb9.htm">...
4
by: Brian Gordaychik | last post by:
Hey all, I have a web application which loads a wizard (another smaller form to get user info). As soon as the wizard completes, I need to have the original page from which the wizard was called...
4
by: bnob | last post by:
In a Button clik event I have this code at the end of the event Response.Redirect("Page.aspx") But in this event I must show a message before redirect to the Page.aspx. I use to show Message...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
3
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, I have an event procedure as shown below. protected void lnkBtSendEmail_Click(object sender, EventArgs e)
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.