469,304 Members | 1,796 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

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 35924
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Kai Grossjohann | last post: by
11 posts views Thread by Dana Smith | last post: by
1 post views Thread by Julius Mong | last post: by
3 posts views Thread by annon | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.