tar*_*ras 12 ajax jquery internet-explorer-7
我在IE7上遇到jQuery AJAX调用问题.这个简单的代码适用于FF和Opera.但在IE7上需要3-5秒. - 这比FF快20倍!加载内容是纯HTML和内联JavaScript代码.没有JS渲染.我甚至改变了内联JavaScript代码.布依然缓慢.
$('#block').load('some url');
Run Code Online (Sandbox Code Playgroud)
如何克服这个问题?任何帮助将不胜感激.
慢速jscript ie7引擎我遇到了同样的问题.我为人类添加了一个状态弹出窗口.当JS以块的形式进行时,我更新状态窗口.伪代码:
var t = setTimeout("next_step(2)", 0); // Where arg of 2 would mean do the second step // This will yield to the browser, and the display will then be updated. // If you want to maintain the value of "this" in the function, then do // something like var t = setTimeout("next_step.call(MyContext, 2)", 0); // using call to set the function's context.
底线是用户将在屏幕上看到一些变化.注意,相对而言,超时为0的屈服步骤需要相当长的时间.所以我的代码测试浏览器,如果它不是IE,那么每个块的工作量会更多.
向用户提供变化的反馈非常重要.否则他们认为这比实际需要的时间更长.
HTH,
拉里