- Create Account

Getting HTML Content via Iframe

Forums > HTMLHttpRequest > Getting HTML Content via Iframe
Author
Message

1) Suresh Group: Guests
IP: 162.111.--.--
Hi

 I have a simple html page i would like to load using your HtmlhttpRequest.js and form post However .. The problem i am running into .. It is not loading the entire html ..

It  is loading only the body tag and on .. .. in the copyContet method the doctext has the full document ie (<html><head>...</head><body>)

however during the process of the method I am trying to take the content (entire one) and trying to assing it to a Div .. and it keeps throwing up a runtime exception

I  have even tried to see if i can get the document from the iframe it uses to submit and assign it another iframe i have on the parent page , it gives object not supported .

These  request are on the same domain

Any  help in pointing me in the right direction would be great


if (src && src.innerHTML) dest.innerHTML = src.innerHTML; throws a run time error



2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Er... you can't actually load any content from the <head> into a <div>. It's just not legal by the HTML specs.

If you want to load an entire page into another page like an IFRAME... well, use an IFRAME!

- Angus.

3) www.indianhits.page.tl Group: Guests
IP: 202.53.--.--
yeah use iframe like this

<iframe src="http://indianhits.page.tl/home.htm" width="800" height="100"></iframe><br>

visit my site http://www.indianhits.page.tl

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.