大佬教程收集整理的这篇文章主要介绍了javascript – iframe中的操作会破坏我的脚本jQuery,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<iframe class="test" width="100%" height="100%" src="/message.html?msjId=260" style="height:100%;width:100%;"> $(window).load(function () { $('.test').each(function(){ var filteredContents1 = $(this).contents().find('.div_iframe').html(); $(this).contents().find('body').html(filteredContents1); }); });
有什么解决方案吗
$(document).ready(function(){ $('.test').load(function () { var filteredContents1 = $('#frame1').contents().find('#divChild').html(); $('#frame1').contents().find('body').html(filteredContents1); }); });
根据提问者的要求更新
$(document).ready(function(){ $('.test').load(function () { $('#frame1,#frame2,#frame3').each(function(){ var filteredContents1 = $(this).contents().find('#divChild').html(); $(this).contents().find('body').html(filteredContents1); }); }); });
.
以上是大佬教程为你收集整理的javascript – iframe中的操作会破坏我的脚本jQuery全部内容,希望文章能够帮你解决javascript – iframe中的操作会破坏我的脚本jQuery所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。