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.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
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 functiongetItems
.http://jsfiddle.net/u6bKr/3/
UPDATE:
As specified in comment by Boris Zbarsky this trouble can be also avoided when adding
window.
beforegetItems()
(e.g.window.getItems()
).Your fiddle sample shouldn't work in any browser because you've defined the
getItems()
method inside theonload
handler that is the jsfiddle default (as set on the left-hand side) which in turn means that it is not in scope from the inlineonclick="getItems()"
attribute.It works in FF if you fix that by selecting
no wrap (head)
instead ofonLoad
, thus making your function global: http://jsfiddle.net/u6bKr/1/(Note that this has nothing to do with
href="javascript:void(0);"
)