简体   繁体   English

jQuery ajax()或load()在IE中返回不完整的响应。 在Chrome中正常运行

[英]JQuery ajax(), or load() return incomplete response in IE. Works fine in Chrome

When using JQuery's asynchronous method to GET a remote URL through either ajax() or load() , the returned response is corrupted in IE but completely correct in Chrome. 当使用JQuery的异步方法通过ajax()load() 获取远程URL时,返回的响应在IE中已损坏,但在Chrome中完全正确。

Here is the sample code 这是示例代码

    $('#contactEmailPanelBody .panel-body').load('contact/email/list/' + id, function(response, status, xhr) {
        console.log('status=' + status);
        console.log('head=' + xhr.getResponseHeader('contentType'));
        console.log('response=' + response);

    });

The response is incomplete and corrupted when using IE/11. 使用IE / 11时,响应不完整且已损坏。 But the complete correct document was successfully returned when using Chrome. 但是使用Chrome时,成功返回了完整正确的文档。

I've done a lot research and seems this is not caused by cache. 我做了很多研究,看来这不是由缓存引起的。 It seems some weird behavior of IE. 看来IE有一些怪异的行为。

Any help? 有什么帮助吗? Thanks! 谢谢!

I think of 2 possible reasons: 我认为有两个可能的原因:

  1. The first is that in internet explorer asks you permission to run scripts that run on files inside your pc, the best thing would be to try upload them to the server and test them from the server, maybe there if the function works well, 首先是在Internet Explorer中,您要求您允许运行在PC内文件上运行的脚本,最好的办法是尝试将它们上传到服务器并从服务器进行测试,如果功能运行良好,也许在那里
  2. The second is to check the compatibility of browsers with the version of jquery you are using, you can do it at: http://jquery.com/browser-support/ , you may have to put some patch compatibility for the browser you are Using. 第二个是检查浏览器与您使用的jquery版本的兼容性,您可以在以下位置执行此操作: http : //jquery.com/browser-support/ ,您可能必须为所使用的浏览器添加一些补丁程序兼容性使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 jQuery.ajax类型:发布到IE中未初始化的ashx文件。 在FF,Chrome和Safari中正常运行 - jQuery.ajax type: Post to an ashx file not being initiated in IE. works fine in FF, Chrome, and Safari 加载的内容在Ajax .load()之后丢失charset(UTF-8),但仅在FireFox和IE中。 Chrome和Opera可以正常运行 - Loaded content loses charset(UTF-8) after Ajax .load(), but only in FireFox and IE. Chrome and Opera works fine <a href doesn't fire after .Click jquery function call in IE. Works fine with Chrome and FF - <a href doesn't fire after .Click jquery function call in IE. Works fine with Chrome and FF Javascript / jQuery无法在Firefox,Safari和IE中运行。 精通Opera和Chrome - Javascript/jQuery not working in Firefox, Safari and IE. Fine in Opera and Chrome jQuery ajax发布在IE,FF,Chrome中正常运行,但在Safari中无法正常运行 - jquery ajax post works fine in IE, FF, Chrome but not Safari 复选框上的jquery ajax调用失败,即在Chrome和Firefox中工作正常 - jquery ajax call on checkbox fails in ie, works fine in Chrome and Firefox jQuery加载不适用于IE 9(在FF,Chrome和Safari上正常运行) - jQuery load does not work on IE 9 ( works fine on FF, Chrome and Safari) jQuery手风琴未在Chrome / IE中显示。 在Codepen中工作 - JQuery accordion not displaying in Chrome/IE. Works in Codepen AJAX jQuery调用无法在IE7,IE8中触发,但可以在Firefox,Chrome等系统中正常运行 - AJAX jQuery call not firing in IE7, IE8 but works fine in Firefox, Chrome, etc jQuery AJAX发布请求不适用于IE或FF-在Chrome中正常运行 - JQuery AJAX Post request doesn't work in IE or FF - Works fine in Chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM