How to check whether there is a specific sentence in an iframe?
how can I check with javascript whether in an iframe there is a specific text or not? For example if I have the ifr开发者_高级运维ame linking to www.example.com and now I want to check whether there is a the text "This is a test" on this site. I tried: Document.getElementsByTagName('Iframe')[0].innerHTML
but it doesnt work. Do you have another solution? I dont want to use Curl or some php functions, it needs to be done in javascript.
Thank you! phpheini
Since your example uses a domain name, I'm going to assume you mean "A third party webpage" and not one that is on your own server.
I'm also going to assume that you mean "JavaScript running in the browser".
This is impossible for security reasons as described by the same origin policy.
精彩评论