IE returns incomplete HTML via Ajax

走远了吗. 提交于 2020-02-05 06:34:27

问题


It comes down to this line:

jQuery.ajax(
{
    type    : "POST",
    url     : "....",
    data    : daten,
    dataType: 'html',
    success : function(response)
    { 
        jQuery('div[id="Main"]').html(response);
        ...

The problem ist that IE responds incomplete blocks of the "response" depending of what IE Version I use. Like it does not return any content in IE 8 whereas it returns like 90 % of the content in IE-9. Interesting thing is: in IE-9 it cuts off html-code (like 10 lines) but then it goes back on. It does not cut off completely it just randomly creates "holes" in the HTML code.

In IE 10 it works just fine ... on my machine, on others it does not.

We already tried to use append(), appendTo(), empty(), innerHtml and all that stuff but none of them worked.

Also, we are working in Demandware; so there is just the production instance, that does not show the code correcty. All other instances are working with the same code-version.

Seems like anything that is being loaded additionally makes the ajax Call go cray in IE.

Does anyone have an idea how to fix this ?


回答1:


The solution was a <!-- starting tag inside a javascript. Because it was not closed but divided by \r, older IE browsers could not handle it



来源:https://stackoverflow.com/questions/24364750/ie-returns-incomplete-html-via-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!