Iframe calling the Easyui box in the parent page

Reposted from https://www.cnblogs.com/puke/archive/2012/09/13/2683067.html

Have tried this method

Get the parent page elements in the iframe child page
The code is as follows:
$(‘#objId’, parent.document);

This way you can get the elements of the parent page , But when calling the method of EasyUI, an error will be reported.

I was depressed for a long time, and finally found the plan, the difference in writing is as follows:

parent.$(‘#objId’)

< p>In this way, no error will be reported when calling the method

Such as:

parent.$(‘#objId’).tabs(“add”, {

title : title,
content: content,
closable: true
});

Please see the picture below, this is the effectshare picture

Click the add button to open the add page

< p>Share pictures

Get parent page elements in iframe child page
The code is as follows:
$(‘#objId’, parent.document);

parent.$(‘#objId ‘)

parent.$(‘#objId’).tabs(“add”, {

title: title,
content: content,
closable: true
});

parent.$(‘#objId’).tabs(“add”, {

Leave a Comment

Your email address will not be published.