利用JQuery操作iframe父页面、子页面的元素和方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/document_dom/article/details/88557154

在iframe中查找父页面元素的方法:

    $('#id', window.parent.document)

在父页面中获取iframe中的元素方法:

	1、$(this).contents().find("#suggestBox")
	
	2、$("#objid",document.frames('iframename').document)

在iframe中调用父页面中定义的方法和变量:

	parent.method parent.value

猜你喜欢

转载自blog.csdn.net/document_dom/article/details/88557154