作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我使用ajax加载页面时,我尝试使用flash或文本来显示页面正在加载。下面的代码在 Firefox 和 Chrome 上运行良好,但不适用于 IE。我不知道问题所在。看来类(class)根本没有停止。
这是我的 Jquery 脚本
$(document).ready(function(){
$.ajaxSetup({cache: false});
$demo='tse';
$('#loading').ajaxStart(function(){
$(this).show();
}).ajaxStop(function(){
$(this).hide();
});
$('#ui_demo_1').click(function(){
$.get('ajax_feed.php',{
demo:$demo
},function(data){
$('#ui_demo').html(data).fadeIn(700).css('font-weight','italic');
return false;
});
return false;
});
});
这是我的 html 代码:
<a href="#" id="ui_demo_1">Click here</a>
<span id="loading">
Loading ...
</span>
<div id="ui_demo">
</div>
如有任何帮助,请...
最佳答案
您的 ajax 调用的成功函数可能因某些错误而失败。我有一个类似的案例。 IE 不会告诉您任何信息,只是不会触发 ajaxStop
。
关于Jquery ajaxStop 不适用于 IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4099564/
我是一名优秀的程序员,十分优秀!