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.

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: ??
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?
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.

These will open the page in the current window:
open(urlstr,"_top","",true);  // replaces the all framesets if there have been any
open(urlstr,"_self","",true); // opens in current frame
With your url this would be:
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.

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:

<input type="button" value="Join Our Newsletter" onClick="'join.htm',"_blank",""); ">
In the third paramter you can define several options how the new window is supposed to look like. (see: 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.

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
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="'join.htm','_blank','');">
baybookAuthor Commented:
Thank you for the link.  I have found what I was looking for.

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

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.