Here's my link:
<a href='javascript://' onclick="Showpopup('baby');">Baby</a>
How would I call this link in JavaScript:
http://babyrus.com
Printable View
Here's my link:
<a href='javascript://' onclick="Showpopup('baby');">Baby</a>
How would I call this link in JavaScript:
http://babyrus.com
If you don't mind my reworkthis would serve better, as if someone does not have javascript enabled, they would still get the link, in a new window.Code:<a href="http://babyrus.com" target="_blank" onclick="Showpopup(this.href);return false">Baby</a>
I hope someone does not add a comment that "target" is deprecated. It still works, and IMHO, whatever eurocrat decided to deprecate the tag should be dismissed with extreme prejudice.
return false; means that if javascript is enabled the function Showpopup(this.href) runs and the default action of the link wont execute which is href="http://babyrus.com" target="_blank" (opens that link in new window).