how to inject the javascript code into iframe? [closed]

坚强是说给别人听的谎言 提交于 2019-12-13 03:37:47

问题


I have an iframe(src is google.com)..I want to inject the javascript code for find the list of anchor tags present in the iframe from parent to iframe.Is it possible to inject the code?

Thanks.


回答1:


It is not possible because of the same-origin policy.

See http://en.wikipedia.org/wiki/Same_origin_policy.

And because you do not have access the Google's server configuration, you won't find any help here either: Ways to circumvent the same-origin policy .



来源:https://stackoverflow.com/questions/15186909/how-to-inject-the-javascript-code-into-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!