Change handler not called on radio input on Firefox
I've di开发者_如何学运维stilled the issue down to this jsfiddle: http://jsfiddle.net/shaggyfrog/DUqYW/3/
On Chrome/Mac and Safari/Mac, you should get the "foo" alert every time you (re)load the page.
On Firefox/Mac, the "foo" alert only comes up the first time. Subsequent reloads do not trigger it.
This is either: (A) a bug in jQuery on Firefox, where a change handler on a radio input should get called irrespective of its state when it's checked; (B) a different jQuery bug, where the change handler should not be called if it's already checked; or (C) me doing something stupid.
Is this a legitimate bug or am I a legitimate n00b?
When you reload, Firefox preserves the checked state of radios from before the reload, so your script clicks an input that is already checked... and hence there is no value change.
精彩评论