How to find a specific word in an iframe
page?
I don't have control over the iframe
page so all codes must be placed in teh parent page.
This is a code to find a word in the parent page
init();
function init()
{
searchWord("exgirlfriend");
}
function searchWord(word)
{
var pageResults = document.body.innerHTML.match(word);
if(pageResults)
{
alert("word found");
}
}
由于相同的原始策略,您无法访问来自另一个域的iframe的内容。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.