html - Internet Explorer 不呈现从 JQuery ajax post 返回的 html

标签 html ajax internet-explorer jquery rendering

我有一个带有输入框的页面,其 onkeyup 根据输入的内容(搜索字段)触发 JQuery ajax post

ajax 调用的回发 html 应该填充页面上的另一个 div。

这是 jquery ajax 帖子:

var o = $(me.results).empty().addClass("aj3load");

$.ajax({
  type: "POST",
  dataType: "text",
  url: me.url,
  data: "cmd="+escape(me.cmd)+"&q="+q+"&"+me.args,
  cache: false,
  complete: function() {
    $(o).removeClass("aj3load");
    me.ls = q;
  },
  success: function(msg){
    $(ajax3.results)
      .html(msg)
      .find("div")
      .click(function(){
        var crs_id = $(this).find(":hidden").val();
        $(ajax3.field).val($(this).text());
        $(ajax3.vf).val(crs_id);
        $(ajax3.results).empty().slideUp("fast");
        ajax3.ls = $(this).text();
        getEventInfo();
      });
  }
});

这是搜索“eve”时 ajax 调用的响应(每个 Fiddler):

HTTP/1.1 200 OK
Cache-Control: private
Date: Thu, 03 Dec 2009 16:16:05 GMT
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Vary: Accept-Encoding
Content-Length: 882

<div><input type="hidden" value="1000806" />111_Demo_Event_090924</div>
<div><input type="hidden" value="1000811" />123 Test Event oct 12 2009</div>
<div><input type="hidden" value="1000805" />AAA_Demo_Event</div>
<div><input type="hidden" value="1000103" />Developing Algebraic Thinking in Grades 3-5 - 30hr</div>
<div><input type="hidden" value="1000086" />Developing Algebraic Thinking in Grades K-2 - 30hr</div>
<div><input type="hidden" value="1000144" />Facilitating Oral Language Development (Grades PreK-3) - 30hr</div>
<div><input type="hidden" value="1000613" />Free PBS TeacherLine Event</div>
<div><input type="hidden" value="1000088" />Math in Everyday Life for Grades 6-8 - 15hr</div>
<div><input type="hidden" value="1000087" />Math in Everyday Life for Grades K-5 - 15hr</div>
<div><input type="hidden" value="1000163" />Using Multimedia to Develop Understanding - 30hr</div>

现在在 firefox 和 chrome 中,所有这些 div 都显示得很好,但在 IE 中,只有第一个 div 显示在页面上的容器 div 中。

知道这里的 IE 出了什么问题吗?

更新: 如果我发出警报(“ Hello World ”);在我分配 $(ajax3.results).html(msg)... 调用后,IE 将正确呈现 ajax 帖子响应。这不是解决方案,只是可能有助于调试。我不想在处理过程中出现警告框。我还发现这个问题似乎不会影响 IE 8,只会影响早期版本。

谢谢

最佳答案

希望不大,但是 ajax3.results 的样式是什么?它是否有可能具有固定的溢出高度:隐藏?或者您可能遇到了渲染错误...如果您在调用后调整浏览器大小(以触发重绘),是否会显示其他字段?

关于html - Internet Explorer 不呈现从 JQuery ajax post 返回的 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1841047/

相关文章:

javascript - 轮询卡住、Pebble.js、ajax、node.js

javascript - event.preventDefault();不在ajax中工作

javascript - 使用 IE 和 SSL 编写 Dojo

html - 即使滚动,所有 parent 的 scrollTop 都是 0

python - BeautifulSoup: TypeError: 'NoneType' 对象不可订阅

php - 使用 AJAX 删除表/数据库项目时出现问题

html - Modernizr 在 IE8 上测试拖放

asp.net - Response.Write - Internet Explorer 中的文件名编码错误

javascript - 用于解析 excel 的 XLSX 解析器

html - 有没有办法在播放后立即隐藏 HTML5 视频?