Gossamer Forum
Home : General : Internet Technologies :

Javascript Popup Windows

Quote Reply
Javascript Popup Windows
Hi,
I'm wondering if the return false in following code will work in most browsers (without javascript support or with javascript turned off) or if I'm better off using <nonscript></nonscript> tags?

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>

<a href="http://www.url_for_non_javascript" onClick="MM_openBrWindow('http://www.url_for_javascript','Test','toolbar=no,scrollbars=no,resizable=no,width=400,height=200'); return false;" target="_blank"><img src="http://www.url_to_image" border="0"></a>


If I'm better off using the <nonscript></nonscript> tags, how can I write the code so my link (in blue) is incorporated between the <script></script> tags?


<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->

/// Where do I put this code ?????? /////
<a href="javascript:;" onClick="MM_openBrWindow('http://www.url_for_javascript','','width=400,height=200')"><img src="http://www.url_to_image" border="0"></a>

</script>
<noscript>
<a href="http://www.url_for_non_javascript" target="_blank"><img src="http://www.url_to_image" border="0"></a>
</noscript>

Thanks
Simon.

Quote Reply
Re: [jai] Javascript Popup Windows In reply to
I just realized the typo - <nonscript> should be <noscript>.
Any feedback on my question would be most appreciated.
Thanks.