1

when ever i use

window.location.href=//some url

it always open a new window, this only happens when the parent window is an dialog box. Any idea what i did wrong?

i tried using

window.open("http://asdf.com", "_self");

as suggested on this thread window.location.href opens another window but it is still not working

thanks

asked Apr 14, 2010 at 10:38

2 Answers 2

3

Stumbled upon this question and thought I would offer an alternative. If you run into trouble with popup blockers, you can use plain old HTML to launch a url in a new window/tab. You won't have as much control over that is displayed (scrollbars, toolbar, etc), but it works even if javascript is disabled and is 508 compliant:

<a href="http://www.google.com/" target="_blank">Open new window</a>

You can read more about the various target attributes here: https://developer.mozilla.org/en/HTML/Element/a

answered Apr 12, 2011 at 18:14
Sign up to request clarification or add additional context in comments.

Comments

2

Parent window

window.open("http://asdf.com", "window_name","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");

code in a parent window to open new

window.open('http://www.google.com', 'window_name', '_self')
answered Apr 14, 2010 at 11:04

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.