在没有刷新的情况下实时更新网页上的iframe内容 [英] update Iframe content on web page in Real time without Refresh

查看:74
本文介绍了在没有刷新的情况下实时更新网页上的iframe内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hey. is there any way to update some iframe content in real time without refreshing the page?

here's example:

i have 2 pages

page1.html & page2.html

page1.html contains :

    <iframe src="page2.html"></iframe>


and page2.html contains : some divs or some video etc.. and when i updated that page2.html and uploaded it, so user don't have to refresh page1.html to see it. it should be refreshed by it self when there's update.

Thanks.

推荐答案

使用此....

use this....


document )。ready( function (){
(document).ready(function() {


' #yourIframeId') .contents()。find(' body')。html(' 您在html标签格式中的更改');
});
('#yourIframeId').contents().find('body').html('your changes in html tag formate'); });


这篇关于在没有刷新的情况下实时更新网页上的iframe内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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