LucaUWF
02-07-2008, 03:45 PM
Hi,
I am nOOb to Javascript and wanted to extract HTML from another website.
I tried this by using an iframe that opened up the desired webpage and called a script to read the innerhtml of the frame using the onLoad event.
It fails however with a Permission Denied error when trying to extract the html via the script (see code below).
Not sure if I am doing something worng, or if this is just not allowed on ClientSide scripting (I can appreciate writing isn't) but not being able to read.
Anyway, assuming this can't be done in this manner, is there another way in which it might short of using server side scripting?
Thanks in advance
<SCRIPT language = "Javascript">
function readFile()
{
doc=window["myframe"].document.body.innerHTML;
//TBD...
}
</SCRIPT>
I am nOOb to Javascript and wanted to extract HTML from another website.
I tried this by using an iframe that opened up the desired webpage and called a script to read the innerhtml of the frame using the onLoad event.
It fails however with a Permission Denied error when trying to extract the html via the script (see code below).
Not sure if I am doing something worng, or if this is just not allowed on ClientSide scripting (I can appreciate writing isn't) but not being able to read.
Anyway, assuming this can't be done in this manner, is there another way in which it might short of using server side scripting?
Thanks in advance
<SCRIPT language = "Javascript">
function readFile()
{
doc=window["myframe"].document.body.innerHTML;
//TBD...
}
</SCRIPT>