Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何访问Iframe的父页面元素_Asp.net_Javascript_Jquery - Fatal编程技术网

Asp.net 如何访问Iframe的父页面元素

Asp.net 如何访问Iframe的父页面元素,asp.net,javascript,jquery,Asp.net,Javascript,Jquery,如何访问Iframe的父页面元素。 e、 g.如果我在index.htm中有一个页面index.htm和一个IFrame中的另一个页面,并且希望从该IFrame访问index.htm的元素。javascript: parent.document.getElementById('myElement'); jquery: $('#myElement', window.parent.document); 请参见我对类似问题的回答: 基本上,父窗口为您提供父窗口的“窗口”对象。然后,您可以访问wi

如何访问Iframe的父页面元素。 e、 g.如果我在index.htm中有一个页面index.htm和一个IFrame中的另一个页面,并且希望从该IFrame访问index.htm的元素。

javascript:

parent.document.getElementById('myElement');
jquery:

$('#myElement', window.parent.document);

请参见我对类似问题的回答:

基本上,父窗口为您提供父窗口的“窗口”对象。然后,您可以访问window.document以获取文档。。。因此,您可以使用parent.document.getElementById(id)获取window.document.getElementById()