【JS】浏览器进度条一直Loading

【问题】在使用IFRAME的页面中,用JS动态更改其的src属性后,框架中页面加载完毕,但浏览器进度条还在Loading。

【分析】本人遇到同样的问题,长期得不到解决,网上很多人把这个问题都归结于IE的bug,因而十分无奈。这虽然不是严重的问题,但容易给人错觉,以为页面正在刷新。

 微软原文:When you dynamically add an object that contains an attached behavior to a Web page, and the behavior must be downloaded, the progress bar in Microsoft Internet Explorer continues to increase. The progress bar continues to show progress even after the behavior is downloaded, and the page is rendered. However, the attached behavior works correctly without any unexpected problems.

结论

 微软原文:http://support.microsoft.com/default.aspx?scid=kb;en-us;Q320731 文中介绍了二点

• Avoid dynamically inserting any objects that contain attached behaviors.
• Set the message text in the status bar of Internet Explorer after you add the object.
显然第二种方法比较实用,在页面下载后向状态栏写一行文字即可。

例如,如果要用到location.href = "test.htm";  那么就在test.htm文件的<BODY>元素中, 增加一个onload事件脚本:
οnlοad="window.status='Finished';"

 

我已试过,但该方法还是无效,可能和我的IE8有关,继续找原因。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值