我似乎无法让 IE8 阻止 onclick 功能执行。尝试了许多代码变体。任何帮助,将不胜感激。就目前而言,当我单击链接时,我会弹出不应发生的警报弹出窗口。
<p><a href="#" onclick="openMoreProductVideos('Video title','videocode','false');return false;"><span class="txt">View all videos</span></a></p>
function openMoreProductVideos(title,productCode,fastprevoew)
{
alert ("openMoreProductVideos - should not see this!");
}
$('a[onclick^=openMoreProductVideos]').click(function (event) {
if (event.stopPropagation){
event.stopPropagation();
}
else if(window.event){
window.event.cancelBubble=true;
}
return false;
});