Archive HTML page with DHTML DIV

P

praskris

Hi,

I am having a requirement that a page which has dynamic div contents
has to be archived in Oracle CLOB.

For eg:-

--- Page1.html ---
<html><head>
<script type="text/javascript">
function loadDiv()
{
document.getElementById("div_1").innerHTML="<html><body>This is
first</body></html>";
document.getElementById("div_2").innerHTML="<html><body>This is
second</body></html>";

document.getElementById("div_account_products_consultants").style.visibility
= "";

document.getElementById("div_account_products_globalCash").style.visibility
= "";
}

</script>
</head>
<body>
<p><b>Dynamic divs <b></p>
<div id="div_1"></div>
<div id="div_2"></div>
</body>
<script>
loadDiv();
</script>
</html>
----------------End of HTML source

If you view source the output of the html, the DIVs willnot have the
contents and hence while archiving the above page, I am struck because
the value to the DIV is based on some lot of conditions and finally i
am getting the contents directly written to the DIV using DTML.

I tried following logic but could not proceed:

1) I tried to write the body contents using document.body.innerHTML
and again rewriting. But it my page is having multiple Body tags and
which creates more problem.

Could you please suggest some ways to proceed with this problem?
 
A

Apekatthjerne

Hi,

I am having a requirement that a page which has dynamic div contents
has to be archived in Oracle CLOB.

For eg:-

--- Page1.html ---
<html><head>
<script type="text/javascript">
function loadDiv()
{
document.getElementById("div_1").innerHTML="<html><body>This is
first</body></html>";
document.getElementById("div_2").innerHTML="<html><body>This is
second</body></html>";

document.getElementById("div_account_products_consultants").style.visibility
= "";

document.getElementById("div_account_products_globalCash").style.visibility
= "";

}

</script>
</head>
<body>
<p><b>Dynamic divs <b></p>
<div id="div_1"></div>
<div id="div_2"></div>
</body>
<script>
loadDiv();
</script>
</html>
----------------End of HTML source

If you view source the output of the html, the DIVs willnot have the
contents and hence while archiving the above page, I am struck because
the value to the DIV is based on some lot of conditions and finally i
am getting the contents directly written to the DIV using DTML.

I tried following logic but could not proceed:

1) I tried to write the body contents using document.body.innerHTML
and again rewriting. But it my page is having multiple Body tags and
which creates more problem.

Could you please suggest some ways to proceed with this problem?

I should start by saying that div (in fact all) elements don't need to
have html and body tags, it's just the HTML. For example:

// CODE STARTS
<html><body>This is first</body></html>
// CODE ENDS

becomes

// CODE STARTS
This is first
// CODE ENDS

You can have HTML in it though. For example:

// CODE STARTS
<em>This</em> is <strong>first</strong>
// CODE ENDS

This should fix the multiple bodies within the page. Also, you don't
need the two lines about changing the visibility unless you've changed
it in the stylesheet.
 
P

praskris

Thanks for your reply.

But My problem is to Archive that whole HTML file. Let me explain it
clearly.

1) Refer div_1 and div_2 above.
2) The contents of that DIV will come from a different source
javascript function.
3) I need to save the whole html into a Oracle clob.
4) my problem here is: I can not see the DIV contents in the saved
html file. I am seeing only
<div></div> inside my saved html file. That is because the contents
are written using dhtml.
5) I need my saved html file should have <div>....some dynamic content
</div>

thanks,
Pr.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top