Open a new window with self.location.href??

I want to open a new page using a button. window.location.href does not seem to work. Is there a way to use this to open the link in a new window.??  I know self opens in the same window.

Thanks!
baybookAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bubbledragonCommented:
window.open() ??
0
baybookAuthor Commented:
The link I am opening is site.asp. So u are saying that I should change
self.location.href = site.asp to blank.location.href = site.asp??

 Not working here?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

x4uCommented:
These will open the page in the current window:
open(urlstr,"_top","",true);  // replaces the all framesets if there have been any
or
open(urlstr,"_self","",true); // opens in current frame
0
x4uCommented:
With your url this would be:
open("site.asp","_top","",true);
0
baybookAuthor Commented:
I do not think my question is clear... or maybe there is no way for me to do what I am trying to do.

This is my current tag
<input type="button" value="Join Our Newsletter" onClick="self.location.href='join.htm'; ">

Can this (self.location.href='join.htm)  be changed so that the link opens in a NEW window?
In other words, after clicking the button, I will have 2 web browers open.

Thanks
0
x4uCommented:
This can be done with the open() function too but with another pseudo target: "_blank". You can see short explainations of all pseudo targets here: http://www.codetoad.com/html/frames/specifying_frames.asp

<input type="button" value="Join Our Newsletter" onClick="window.open('join.htm',"_blank",""); ">
In the third paramter you can define several options how the new window is supposed to look like. (see: http://www.blazonry.com/javascript/windows.php) But not all browser respect all of them.

You can also use any other name instead of _blank (and that is not yet used as a frame name) to get a new window and all further clicks would show in this window if it is still open and otherwise reopen it. With "_blank" you get a new window every time you click the link regardless of how many windows are already open.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
x4uCommented:
oops, I messed up the quotes. They need to be single quotes because the function call occurs in the attribute value that uses double quotes:
<input type="button" value="Join Our Newsletter" onClick="window.open('join.htm','_blank','');">
0
baybookAuthor Commented:
Thank you for the link.  I have found what I was looking for.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.