Google Answers Logo
View Question
 
Q: <span class="link" onclick="window.location='URL' "> ( No Answer,   3 Comments )
Question  
Subject: <span class="link" onclick="window.location='URL' ">
Category: Computers > Internet
Asked by: joethomas-ga
List Price: $2.00
Posted: 05 Feb 2005 21:17 PST
Expires: 07 Mar 2005 21:17 PST
Question ID: 469727
Hi there,

I'm using this for some links on my site:

<span class="link" onclick="window.location='URL' ">

And then using CSS to identity the color of the link.  Currently, that
code above will open the link in the same window.  How can I easily
modify that code so that it will open that javascript link in a NEW
window?

Thanks!
Answer  
There is no answer at this time.

Comments  
Subject: Re: <span class="link" onclick="window.location='URL' ">
From: pseinstein-ga on 05 Feb 2005 21:56 PST
 
Shouldn't <span class="link" onclick="window.open='URL' "> open the
URL in a new window?
Subject: Re: <span class="link" onclick="window.location='URL' ">
From: eezee-ga on 06 Feb 2005 04:56 PST
 
try this one;

<span class="link" onclick="window.location='URL' " target="_blank">
Subject: Re: <span class="link" onclick="window.location='URL' ">
From: thisisnull-ga on 06 Feb 2005 05:33 PST
 
do this 

<span class="link" onclick="window.open(URL, name, features, replace)">
where name: is the name of the new window you open
features: is a string of name value pairs defining the new features of
the window. (such things as the size of the window, to show or not
toolbars and location bar  etc.. )
replace: boolean argument that specifies wheather to replace the last
url entry in the browser history.

THe last three arguments are optional so if you dont understand them
dont use them, or  visit netscape website to find out

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy