开发者

JQuery .load() character encoding problem in IE

开发者 https://www.devze.com 2023-03-16 02:13 出处:网络
IE (i\'m using 8) will not show any swedish characters in a document loaded through jquery .load(). The file is part of the former page the client wants untouched, so I can\'t go in and change the enc

IE (i'm using 8) will not show any swedish characters in a document loaded through jquery .load(). The file is part of the former page the client wants untouched, so I can't go in and change the encoding. This is the code I used to embed a fragment fr开发者_Go百科om an HTM doc into the current one (The HTM document is in Windows-1252 and nothing else would work to fix it on Firefox):

$.ajaxSetup({contentType: 'text/html;charset=windows-1252'});

$.ajaxSetup({
        'beforeSend' : function(xhr) {
             xhr.overrideMimeType('text/html; charset=windows-1252');
        },
});

$("#best").load("http://alltomven.se/09-0005-05.htm #table2");

I even have a fix I used for Firefox in there, but this doesn't work for IE. None of the diacritical characters show. What do I do?


Maybe we should try to use UTF-8 charset?

0

精彩评论

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