JS - return false on context menu in FF/IE does not work?
Posted: Thu Jan 19, 2006 12:15 pm
Opera 8.5x works fine, however in IE 6 and Firefox 1.5 return false fails on the test page below and the context menu still appears. What am I missing here? Keep in mind the page is being served as application/xhtml+xml please, thanks!
John
John
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Context Menu Issue</title>
<script type="text/javascript">
//<![CDATA[
function download() {alert("This is a download link, right click to save the file!"); return false;}
function preview() {alert("This is a preview link, left click to preview the song!"); return false;}
//]]>
</script>
</head>
<body>
<div>
<a class="download" href="download.mp3" onclick="download();return false;">Download</a>
<br />
<a class="music" href="preview-hi.php" onmouseup="preview();return false;" rel="mplayer" title="Play the high quality preview of this song.">Hi-Fi Play</a>
<br />
<a class="music" href="preview-lo.php" onmouseup="preview();return false;" rel="mplayer" title="Play the low quality preview of this song.">Lo-Fi Play</a>
</div>
</body>
</html>