IE6下 location.href BUG

代码如下:
<script type=”text/javascript”>
loadURL = function(){
location.href = “http://www.aobodo.com”;
}

</script>
<a href=”javascript:void(0);” onclick=”javascript:loadURL();”>Link1</a>
<a href=”#” onclick=”javascript:loadURL();”>Link2</a>
<a href=”javascript:loadURL();”>Link3</a>

以上三种方式在IE7+,Firefox下可以正常执行,第一种方式在IE6-没有响应。

第一种方式要想在IE6-下正常执行,需要修改成<a href=”javascript:void(0);” onclick=”javascript:loadURL();return false”>Link1</a>。

This entry was posted in IE, javascript. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>