时间:2021-07-01 10:21:17 帮助过:7人阅读
$(window.parent.
document
).contents().find("#iframeID")[0].contentWindow.initPagerList();说明:
iframeID 为iframe的ID;
initPagerList 为 iframe 页面内的方法。
<html>
<head>
<title></title>
<script>
$(function(){
/*
说明: iframeID 为iframe的ID;
initPagerList 为 iframe 页面内的方法。
*/
//调用iframe页面iframeID中的initPagerList方法
$(window.parent.document).contents().find("#iframeID")[0].contentWindow.initPagerList();
//获取iframe页面iframeID中的文本框txtControlID对象
var txtControlObj=$(window.parent.document).contents().find("#iframeID")[0].contentWindow.find("#txtControlID");
//为iframe页面iframeID中的文本框txtControlID赋值
txtControlObj.val("我就是你需要设置的内容值!");
});
</script>
</head>
<body>
</body>
</html>相信看了本文案例你已经掌握了方法,更多精彩请关注Gxl网其它相关文章!
推荐阅读:
jquery+js调用iframe父窗口与子窗口步骤详解
以上就是基于ID调用iframe页面(附代码)的详细内容,更多请关注Gxl网其它相关文章!