如何在Javascript中将属性值从iframe传递给父级?

如何在Javascript中将属性值从iframe传递给父级?

问题描述:

如何将属性值从iframe传递给父级?

How can I pass attribute value from iframe to parent?

I.e。 iframe(frame1)具有< a id =a1href =http://www.infinitybusiness.net> 。如何在我的父页面中获得 href 的值?

I.e. iframe (frame1) has <a id="a1" href="http://www.infinitybusiness.net">. How can I get value of href in my parent page?

这是一个很好的教程,可以准确地说明:
http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

This is a great tutorial that talks exactly about that: http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

只有当两个页面来自同一个域时才能使用它。
有很多跨域脚本解决方案..你可以在这里阅读更多:
http://softwareas.com/cross-domain-communication-with-iframes

you can use it only if the two pages are served from the same domain. There are many solution for cross-domain scripting as well..you can read more here: http://softwareas.com/cross-domain-communication-with-iframes