May 9th, 2006, 09:59 PM
Join Date: May 2006
Time spent in forums: 50 m 31 sec
Reputation Power: 0
Getting and Parsing a page source
I have looked through this site for similar subjects but couldnt find what I was looking for, forgive if I missed.
Here is what I would like to accomplish:
I load a webpage, in another domain into an iframe and I would like to get to the source code of it, or at least to the <body> tag. I dont want to edit it or pass anything to it, I just want to get the source, parse through it and depending on what I find do other stuff unrelated to that page.
Here is what I have:
var myhtml = document.frames('gameframe').document.body.innerHT ML;
Now, this works, but I get "Access Denied" error message.
I think because my parent page and the page I am looking at in the iframe are on different domains it is restricting access. I would like to know if it is possible to get around, maybe using XMLHTTPRequest or something else...
Thank you in advance