Is it possible to use javascript to grab data on a webpage -- with data that's only available on clientside?
| SitePoint Sponsor |
Is it possible to use javascript to grab data on a webpage -- with data that's only available on clientside?





Javascript only has access to the iframe if the domain of the page where the javascript came from is the same as the domain of the iframe.
how do you grab the content of the iframe using javascript? (can you point out the functions i should look up, outline the process?)





from the parent page...
where the iframe in question has name="myframe". You can also reference by index.Code:<button onclick="alert(window.frames['myframe'].document.innerHTML);">test</button>
that should get you started





First, practice grabbing content on a page that does not have an iframe, e.g. document.getElementById("elmtID").innerHTML.how do you grab the content of the iframe using javascript?
After you feel comfortable with the way that works, you can get the content in an iframe the same way, but add:
frames["iframeName"].
onto the front of the commands. Just remember: if the page in the iframe is not your page, you won't be able to use javascript to get content from it.
Bookmarks