[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]

For me it was just an appendChild() that was causing the problems. You can always try the innerHTML+= way if all else fails 😉

0 0 vote
Article Rating
Subscribe
Notify of
guest
4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Bubuletz
Bubuletz
9 years ago

got this too, but after I looked more carefully I noticed the problem. the code was:

var a = document.createElement(“a”);
a.appendChild(‘hello world’);

someDiv.appendChild(a);

Problem is at line 2. The correct way is:
a.appendChild(document.createTextNode(‘hello world’));

dali
dali
9 years ago

same ! FFS

???????
9 years ago

The same problem