Home >Web Front-end >JS Tutorial >Call the iframe page based on ID (code attached)
This time I will bring you the call to the iframe page based on the ID (with code). What are the precautions for calling the iframe page based on the ID? The following is a practical case, let's take a look.
$(window.parent. document ).contents().find("#iframeID")[0].contentWindow.initPagerList();
Description:
iframeID is the ID of the iframe; initPagerList is the method in the iframe page.100db36a723c770d327fc0aef2ce13b1 93f0f5c25f18dab9d176bd4f6de5d30e b2386ffb911b14667cb8f0f91ea547a76e916e0f7d1e588d4f442bf645aedb2f 3f1c4e4b6b16bbbd69b2ee476dc4f83a $(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("我就是你需要设置的内容值!"); }); 2cacc6d41bbb37262a98f745aa00fbf0 9c3bca370b5104690d9ef395f2c5f8d1 6c04bd5ca3fcae76e30b72ad730ca86d 36cc49f0c466276486e50c850b7e4956 73a6ac4ed44ffec12cee46588e518a5eI believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website! Recommended reading:
jquery js calls the iframe parent window and child window Detailed explanation of steps
The above is the detailed content of Call the iframe page based on ID (code attached). For more information, please follow other related articles on the PHP Chinese website!