[Exception… “Could not convert JavaScript” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)”
What the heck is..
uncaught exception: [Exception… “Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]” nsresult: “0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)” location: “JS frame :: PATH_TO_MY_JAVASCRIPT_FILE :: THE_METHOD_NAME :: line #” data: no]
This error shows up in Firefox when you try to append something that isn’t a valid DOM node. The most common cause is passing undefined or a string directly to appendChild() instead of a proper element. I spent a while debugging this one before realizing I had a typo in my createElement call that was returning undefined.
For me it was just an appendChild() that was causing the problems. You can always try the innerHTML+= way if all else fails 😉
If you’re hitting this in older Firefox versions, also check that you’re not accidentally passing a jQuery object to a native DOM method — they’re not interchangeable.