6
'69 Camaro
Perhaps I'm Googling for the wrong terms. Does anyone have links to
examples of the syntax necessary to read the HTML on another Web page when
that HTML is produced from JavaScript using the document.write( ) method?
For a simplified example, I have two Web pages. Page 1 uses JavaScript with
the following:
htmlData = "<B>This is bold text.</B>";
document.write(htmlData);
Page 1 displays in bold text:
This is bold text.
Page 2 needs to get the markup for page 1, i.e., just "<B>This is bold
text.</B>" (which includes the tags), not the JavaScript code listed above.
I've tried using the responseText property of the MSXML2.XMLHTTP.3.0 object,
but it gives me the JavaScript used for rendering page 1, not the markup
(that's stored in the htmlData variable).
The ultimate goal is to grab the data displayed on a Web page and display
only the items needed on another Web page. I can parse the HTML based upon
the tags to target exactly the data I want. That's why I need to read the
tags.
Suggestions for other approaches are welcome. I'm the author of both Web
pages, so I have some leeway. Preference is for client-side JavaScript. I
have some experience in JavaScript, but I'm a C/Java programmer.
Cross-platform compatibility is preferred, and the majority of browsers will
be IE6. I can also run Perl scripts on the Web server, but I have little
experience with Perl, so this would be an opportunity to learn more. In
case it matters, the Web server is Apache on Linux.
Thanks.
Gunny
examples of the syntax necessary to read the HTML on another Web page when
that HTML is produced from JavaScript using the document.write( ) method?
For a simplified example, I have two Web pages. Page 1 uses JavaScript with
the following:
htmlData = "<B>This is bold text.</B>";
document.write(htmlData);
Page 1 displays in bold text:
This is bold text.
Page 2 needs to get the markup for page 1, i.e., just "<B>This is bold
text.</B>" (which includes the tags), not the JavaScript code listed above.
I've tried using the responseText property of the MSXML2.XMLHTTP.3.0 object,
but it gives me the JavaScript used for rendering page 1, not the markup
(that's stored in the htmlData variable).
The ultimate goal is to grab the data displayed on a Web page and display
only the items needed on another Web page. I can parse the HTML based upon
the tags to target exactly the data I want. That's why I need to read the
tags.
Suggestions for other approaches are welcome. I'm the author of both Web
pages, so I have some leeway. Preference is for client-side JavaScript. I
have some experience in JavaScript, but I'm a C/Java programmer.
Cross-platform compatibility is preferred, and the majority of browsers will
be IE6. I can also run Perl scripts on the Web server, but I have little
experience with Perl, so this would be an opportunity to learn more. In
case it matters, the Web server is Apache on Linux.
Thanks.
Gunny