[jQuery] FIX: Firefox throwing NS_ERROR_XPC_JS_THREW_STRING when using input.focus()
While this isn't specifically related to jQuery, it certainly could affect
jQuery users, so I thought I'd post the link.
It appears Firefox 1.5 (and lower--I don't believe it exists in v2) has an
internal bug with dynamically created <input /> elements and later invoking
the focus() method on the field. It will occasionally throw the error
"NS_ERROR_XPC_JS_THREW_STRING" and cause browser freezes.
This apparently is a bug in the code relating to Firefox's native
autocomplete functionality and can be worked around by adding the attribute
autocomplete="off" to the elements.
NOTE: This doesn't happen every time, it's a seemingly random occurrence.
For more detail on the problem, see this link:
http://www.activewidgets.com/javascript.forum.3865.1/finally-solved-ns_error
_xpc_js_threw_string.html
I'm posting this just because I'm sure I've seen this problem crop up from
time to time and just never realized it was the culprit. I also thought this
would be useful to other JS developers, since it's quite possible many of
you are creating dynamic <input /> elements.
-Dan