views:

237

answers:

2

The code is simple. Works in every browser but IE.

J.get('/upload/uploadresponse/' + uploaded_lessonfile_id , function ( data ){
   J('#upload-files').prepend( data );
});

alert() on data shows the required data. Html is <div id="upload-files"></div> - no magic there.

Would prefer not to upgrade to jQuery 1.4. Would prefer to wipe internet explorer from the earth.

A: 

Have you tried

J('#upload-files').html( data );

make sure your string is either

var data = ' with " quotes inside '; or var data = " using escape \" ";

c0mrade
Thanks.Yes tried html() - see comment above.Data is the standard Jquery object/string returned from the Ajax call (in this case jQuery.get() ).
Jonathan Hendler
have now verified that html() also fails, not only for that specific DOM element, but parts of the page. @c0mrade. You might be on the right track. but we've spent 10 hours now.
Jonathan Hendler
@Jonathan Hendler, so did you solve it ?
c0mrade
yes, my solution above solved it. Will mark solved tomorrow. Invalid HTML strict was the issue. Don't know if that's a jQuery bug or a IE bug, or not really a bug at all, but a feature - and jQuery should just throw an error.
Jonathan Hendler
+1  A: 

The problem is that the response body had invalid HTML - an extra </div>. It is inserting into a document that is supposed to be HTML strict.

Jonathan Hendler