Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy all html to a variable

Status
Not open for further replies.

ivow

Programmer
Aug 6, 2002
55
CA
Is there a way I can place the equivalent of
document.body.innerhtml to an asp text variable?

As in, all that you would normally view when you choose View>Source copied to a variable in ASP?

is there a way to do this? Ivo
 
Hi,
I assume that you are trying to get the source of your OWN page. You will need to create a page that will automatically 'POST' itself back to yourself:
<html>
<header>
<script language=&quot;jscript&quot;>
function window.onload() {
mySource.value=document.body.innerhtml;
myForm.submit();
}
</script>
</header>
<body>
<form method=post>
<input id=&quot;myForm&quot; type=&quot;hidden&quot; name=&quot;pageAction&quot; value=&quot;reEntry&quot;>
<input id=&quot;mySource&quot; type=&quot;hidden&quot; name=&quot;mySource&quot; value=&quot;&quot;>
</form>
This is my HTML page.
Contains <b>some bold stuff</b>
<%
dim vsPageAction, vsMySource
vsPageAction = lcase( trim( request(&quot;pageAction&quot;) ) )
vsMySource = trim( request(&quot;mySource&quot;) )

if vsPageAction = &quot;reentry&quot; then
--do whatever you want with vsMySource--
end if
%>
</body>
</html>


The concept something like this. I wrote the code on the fly, so it might have bugs ...

regards,
- JOseph
============== ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Shopping --> , Soccer --> ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top