Forum Moderators: open
I have a link that opens a pop-up. In IE, when clicking on the link, it correctly sets the link color to "visited". However, I can't get this working in Netscape. Here are three attempts (all which work in IE, none of which work in Netscape):
<a href="javascript: void window.open( 'popup.htm', 'ignored', 'height=50, width=50' )">link 1</a>
<a href="javascript:void%20window.open('popup.htm','ignored','height=50,width=50')">link 2</a>
<a href="javascript:void" onclick="javascript: void window.open( 'popup.htm', 'ignored', 'height=50, width=50' )">link 3</a>
Ideas on how to make Netscape happy?
<a href="javascript:void();" onclick="javascript:window.open('popup.htm','','width=50,height=50');">pop me</a><br>
<a href="popup.htm" target="_blank" onclick="window.open('popup.htm','','width=50,height=50');return false;">link text</a>
Causes the page to open in a new window if JavaScript is turned off
Causes the JavaScript to be executed instead. return false will cancel the normal link behavior (i.e. you will not get two windows with the same page)
If, however, your onclick handler calls your own function ("myOpen()"), then it's fine to just have "open()" in THAT function. Just not directly in the onclick handler.
(Kinda minor.)