Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 10 years ago

#780 closed bug (fixed)

NS_ERROR_XPC_BAD_CONVERT_JS

Reported by: Jason Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

Description

Error: Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild] = NS_ERROR_XPC_BAD_CONVERT_JS
Source file: (jquery-1.1b.js)
Line: 158

Using code:

$(document).ready( function(){
$("#test").html("");
alert('this will not show');
});

test is just a div, but this error is displayed in the Firefox console. It still seems to actually work by setting it to "", but no code after the .html("") will work.

This is 1.1b on Firefox 1.5 on Windows XP

Change History (4)

comment:1 Changed 15 years ago by Jason

Sorry, not AJAX; core probably?

comment:2 Changed 15 years ago by john

Component: ajaxcore
Milestone: 1.1a1.1
Version: 1.1

Fixed in SVN rev 1009.

comment:3 Changed 15 years ago by john

Resolution: fixed
Status: newclosed

comment:4 in reply to:  3 Changed 10 years ago by Nathaniel Layton

Replying to john: I can reproduce this just FYI.

The work around I used was:

$('#id').html(someObj.stringProperty);/ /Original: doesn't work for some reason

$('#id')[0].innerHTML = someObj.stringProperty;/ /Work-Around: works ok

Though this is a jquery/NS error, it is rare and not worth fixing. Especially when the work around is so simple.

Note if you had multiple dom elements you could use the jquery each function and then innerHTML.

example:

$('.someClass').each(function(i, el){

el.innerHTML = someObj.stringProperty;

});

Note: See TracTickets for help on using tickets.