为什么javascript:void(0)在Firefox中不起作用 [英] Why javascript:void(0) is not working in Firefox

查看:249
本文介绍了为什么javascript:void(0)在Firefox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么这个简单的链接例子在Firefox中不起作用?它是在IE和Chrome中工作。

js小提琴示例

我正在使用Windows XP。我的Firefox的版本是16.0。

解决方案

我对 getItems()显示了在某些情况下这个函数被定义为 native function 。我不知道为什么。为了避免这种麻烦,尝试重命名函数 getItems



http://jsfiddle.net/u6bKr/3/

更新:正如在Boris Zbarsky的评论中指出的那样,当添加窗口时,这个麻烦也可以避免。在<$之前c $ c> getItems()(例如 window.getItems()


Why is this simple link example not working in Firefox? It is working in IE and Chrome.
js fiddle sample
I am using windows XP. My Firefox version is 16.0.

解决方案

My research for getItems() showed what in some situations this function is defined as native function. I don't know why. To avoid this trouble try to rename function getItems.

http://jsfiddle.net/u6bKr/3/

UPDATE:

As specified in comment by Boris Zbarsky this trouble can be also avoided when adding window. before getItems() (e.g. window.getItems()).

这篇关于为什么javascript:void(0)在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆