更改src的属性后如何刷新HTML5中的iframe [英] How refresh iframe in HTML5 after change the attribute of src

查看:573
本文介绍了更改src的属性后如何刷新HTML5中的iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用HTML 5中的iframe标记,通过修改iframe SRC属性后的按钮事件,可以刷新iframe;但是通过调用外部JavaScript函数,在修改SRC之后,SRC值是HTML文件中其他文件下的机器,但无法刷新i​​frame;我hava尝试更多的方法,但没有用。那么,还有其他方法来强制刷新iframe吗?感谢您的帮助。



我尝试过的方法:



我尝试了很多刷新iframe的方法,但是失败了.src的属性改变了成功。

Use the iframe tags in HTML 5, through the button event after modifying the iframe SRC attribute, can refresh the iframe; But through external JavaScript function called, after the modification of the SRC ,The SRC value is the machine under the other files in the HTML file,but cannot refresh iframe; I hava try more method,but no use. So, Is there any other method to enforce refresh iframe?Thank you for your help.

What I have tried:

I hava try a lot of method to refresh iframe,but failed.The Attribute of src have changed success.

推荐答案

如果你包装< iframe>在< div>中,您可以更新div(通过 AJAX [ ^ ])新的< iframe>>内容。我这样做是为了模拟标签。
If you wrap your <iframe> in a <div>, you can update the div (via AJAX[^]) with the new <iframe>> content. I do this all the time to simulate tabbing.


这篇关于更改src的属性后如何刷新HTML5中的iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆