If you want the content of the current page, then all you need to do is: var content = document.body.innerHTML;
If you want another html page, then the only way you can do it with JavaScript is if you are grabbing a page on the same domain and that your browser supports AJAX or iframes.
Eric
Kevin Cornwell
Ranch Hand
Joined: Feb 01, 2005
Posts: 34
posted
0
Originally posted by Eric Pascarello:
If you want another html page, then the only way you can do it with JavaScript is if you are grabbing a page on the same domain and that your browser supports AJAX or iframes.
Eric
use a hidden iframe or something?
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
var content = parent.iframeName.document.body.innerHTML;
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35249
7
posted
0
var content = document.body.innerHTML;
Is innerHTML supported on all the major browsers these days? I think it used to be an IE invention.