这次给大家带来基于ID调用iframe页面(附代码),基于ID调用iframe页面的注意事项有哪些,下面就是实战案例,一起来看一下。
$(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>
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
推荐阅读:
以上就是基于ID调用iframe页面(附代码)的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号