Summary of jQuery's method for operating js functions in iframe, jqueryiframe
This document describes how jQuery operates js functions in iframe. We will share this with you for your reference. The details are as follows:
1. jquery operations on elements in iframe (two methods)
Var tha = $ (window. frames ["core_content" ).doc ument ). find ("# trewuuu" ).html (); var thb =$ ("# core_content "). contents (). find ("# trewuuu" 2.16.html ();
2. Operate the elements in the parent interface (header: id of an element)
$ ('# Head', parent.doc ument). text ()
3. js calls js functions in iframe (2 types)
Window. frames ["core_content"]. window. testIframe2 ("11"); document. getElementById ("core_content"). contentWindow. testIframe2 ("11 ");
4. jquery calls the js function of iframe (parameters with return values)
$ ("# Core_content") [0]. contentWindow. testIframe2 ("11 ");
Note:
It must be in the same domain name as the iframe it contains (because it cannot be cross-origin)