是否有一个跨浏览器替代xhr.overrideMimeType()函数? [英] is there a cross-browser alternative to the xhr.overrideMimeType() function?
问题描述
我没有访问服务器,我需要整个的AJAX交易使用ISO-8859-1的字符集发生。我使用的是jQuery.load()函数一起使用下面的jQuery的方法:
I don't have access to the server and I need that the whole AJAX transaction to happen using the ISO-8859-1 charset. I'm using the jQuery.load() function together with the following jQuery method:
jQuery.ajaxSetup({'beforeSend' : function(xhr) {xhr.overrideMimeType('charset=ISO-8859-15'); }});
尽管Firefox和Chrome都正确返回结果EN codeD,IE浏览器(所有版本)都没有。有什么办法只在客户端解决?
even though firefox and chrome are returning the results correctly encoded, IE (all versions) are not. Is there any way to fix it only at the client-side?
P.S。所有的内容是正确的连接$ C $光盘ISO-8859-1。
p.s. All the content is correctly encoded in ISO-8859-1.
推荐答案
我也有类似的问题,但这个问题基本上是'overrideMimeType不支持IE(任何版本)。所以基本上,你需要做的是这样,在下面的文章:
I just had a similar problem but the issue is basically that 'overrideMimeType' is not supported in IE (any version). So basically you need to do something like in the following articles:
的jQuery,AJAX和Internet Explorer 通过杰里米·希克森或本< A HREF =在这里http://stackoverflow.com/questions/3850765/overridemimetype-alternative-for-ie>问题的StackOverflow
jQuery, AJAX and Internet Explorer by Jeremy Hixon or this question here in StackOverflow
希望这有助于。
这篇关于是否有一个跨浏览器替代xhr.overrideMimeType()函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!