开发者

jquery top.document or not?

开发者 https://www.devze.com 2022-12-09 20:50 出处:网络
I have a page called loader.htm开发者_高级运维l. It contains an iframe, which contains jQuery.

I have a page called loader.htm开发者_高级运维l. It contains an iframe, which contains jQuery.

On index.html, I do <iframe src="loader.html">

How do I access the elements inside loader.html ? top.document ?


Use the contents() method:

$('iframe').contents().find('body');
0

精彩评论

暂无评论...
验证码 换一张
取 消