473,387 Members | 1,798 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,387 software developers and data experts.

Javascript open link in same window

gil
I have a form that I would like to get the values entered on the page
and go to a new page in the same window. I can make the code work to
open a new window, but I need it to open in the same window. Any help
would be greatly appreciated.

Here is what I have:
function pass_info() {

var info = "";

info += document.form2.productWeight.value;
window.open("/page/shippingrates/calculate_shipping_before.asp"
+ "?" + "weight=" + info,");
}

I know that it is the window.open, but I have not figured out what I
need to do to get it in the same window.

Thanks

Jul 23 '05 #1
5 36099
In article <11**********************@z14g2000cwz.googlegroups .com>,
gi*@ambry.com enlightened us with...

I know that it is the window.open, but I have not figured out what I
need to do to get it in the same window.


location.replace or location.href, depending on whether you want it
overwritten or not, respectively.

--
--
~kaeli~
Murphy's Law #2000: If enough data is collected, anything
may be proven by statistical methods.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
gil
I do not want it overwritten, but location.href does not work.
location.replace works, but not what I need. Do you have any other
ideas on what I can use.

Thanks,

Jul 23 '05 #3

g...@ambry.com wrote:
I do not want it overwritten, but location.href does not work.
location.replace works, but not what I need. Do you have any other
ideas on what I can use.

Thanks,


Have you tried using iframe for the window you want to replace?

http://askblax.com

Jul 23 '05 #4
In article <11**********************@g44g2000cwa.googlegroups .com>,
gi*@ambry.com enlightened us with...
I do not want it overwritten, but location.href does not work.


Clarify "does not work".
What happens or doesn't happen?

And if this is a frameset, say so.

What happens (or doesn't happen) when you do the following:

info += document.form2.productWeight.value;
window.location.href = "/page/shippingrates/calculate_shipping_before.asp?
weight=" + info;

Note that word-wrap may split that into three lines when it should be two.

If you get an error, post it.

--
--
~kaeli~
A backward poet writes... inverse.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
gi*@ambry.com wrote:
I do not want it overwritten, but location.href does not work.
It works. Only your source code or the JavaScript Console
can tell why it does not work for *you* *there*.
location.replace works, but not what I need.
It fulfills the requirement of "open in the same window", though.
Do you have any other ideas on what I can use.


Do you have more code or error messages?
PointedEars
--
A true translation needs neither omissions nor addings.
It is its own content.
-- me, 2003
Jul 23 '05 #6

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

Similar topics

13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
11
by: Dana Smith | last post by:
Can anybody explain why when I have a hyperlink on a page with the code similar to below, after the user clicks on the link, the desired window opens but the page with the hyperlink changes to a...
1
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
3
by: annon | last post by:
I've noticed that some problems come up frequently that are of importance in writing web pages, because they're pretty fundamental points. For general reference, here are some collected...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.