<div class="codetitle"> <span><a style="CURSOR: pointer" data="64197" class="copybut" id="copybut64197" onclick="doCopy('code64197')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code64197"> <br><a href="javascript:void(0)" >GoNext</a> <br>$("a").click(function(){ <br>window.location.href = "xxx.html"; <br>}) <br> </div> <br>代码如上,在IE下,特别是在IE6中,点击超链接之后,浏览器并没有发生跳转行为。 <br><br>原因可能是因为在href中的javascript:void(0)阻止的事件行为,解决方法如下: <br><br>1.在onclick事件中加return false来阻止冒泡: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="55911" class="copybut" id="copybut55911" onclick="doCopy('code55911')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code55911"> <br>$("a").click(function(){ <br>window.location.href = "xxx.html"; <br>reutrn false; <br>}) <br> </div> <br>2.延迟100毫秒 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="33885" class="copybut" id="copybut33885" onclick="doCopy('code33885')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code33885"> <br>$("a").click(function(){ <br>setTimeout(function(){ <br>window.location.href = "xxx.html"; <br>},100); <br>}) <br> </div>