This article mainly introduces the method of jQuery to realize the intercommunication between frames, and analyzes the method of jQuery to realize the calling operation between the parent and child frames in the form of examples. Friends who need it can refer to it. I hope it can help everyone.
Parent frame:
// 需要共享的方法 function veriAddData(varname,vardesc){ var name = varname; var desc = vardesc; if(name!==""&&desc!==""){ doAdd(name,desc); } } // 如何共享 if ( $.browser.msie&&+$.browser.version<8 ){//低于ie8的浏览器处理 //ie,先未处理 document.frames["url"].window["veriAddData"] = window["veriAddData"]; }else{ // url为子框架的id $("#url")[0].contentWindow["veriAddData"] = veriAddData; }
Child frame:
// 如何调用父框架的方法 parent.veriAddData($("#varName").val(),$("#varDesc").val());
Related recommendations:
PHP uses iframe to upload images Display
jquery and iframe make an ajax upload effect example sharing
Using JQuery to operate iframe parent page and child page method summary
The above is the detailed content of Sharing examples of interoperability between frames using jQuery. For more information, please follow other related articles on the PHP Chinese website!