开发者

jQuery 1.3.2 append() fails in IE7 and IE8

开发者 https://www.devze.com 2022-12-19 09:46 出处:网络
The code is simple. Works in every browser but IE. J.get(\'/upload/uploadresponse/\' + uploaded_lessonfile_id , function ( data ){

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开发者_StackOverflow社区 the earth.


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.


Have you tried

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

make sure your string is either

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号