I would be grateful for any info on the rules of document.write. I have a
case where a page, including the header, were overwritten by
document.writes. I normally structure my apps so that response.write does
most of the work, so I'm new again. The code is
<HTML>
<HEAD>
<link rel="stylesheet" href="shopstyles.css"><META NAME="GENERATOR"
Content="Microsoft Visual Studio 6.0">
<SCRIPT LANGUAGE=javascript>
function additemtobasket(productnumber, company, brand, productname) {
// document.write a formatted product.
// if product is already there, increment its numberofunits
// -----------------
// If product is not in basket yet, write it in
// Company
document.write("<INPUT type=text class=shopprods readonly width=100 ")
document.write("value=" + company + " ")
document.writeln("name=company" + productnumber + ">")
// Brand
document.write("<INPUT type=text class=shopprods readonly width=100 ")
document.write("value=" + brand + " ")
document.writeln("name=brand" + productnumber + ">")
// Product Name
document.write("<INPUT type=text class=shopprods readonly width=100 ")
document.write("value=" + productname + " ")
document.writeln("name=productname" + productnumber + ">")
// New line
document.writeln("<BR>")
}
</SCRIPT>
</HEAD>
<BODY bgColor=mintcream style="background-image: url(images/paleblue.jpg)">
</BODY>
</HTML>
To use document.write so that it appends code to the page, it has to be
executed while the page is still being parsed by the browser.
Tom Lianza
Carnegie Mellon University
"Justin Dutoit" <justin...@free.net.au> wrote in message
news:OgUnrI89$GA.75@cppssbbsa04...
What is a hidden frame? Also, can I document.write from another frame and
have it append the output? Surely there is some script to just append the
output....
Justin
"Thomas O. Lianza" <tli...@cisco.com> wrote in message
news:u$z#va89$GA.274@cppssbbsa04...
As for a script that appends output using document.write() calls from
another frame... I can't think of a way to do this. If you explain the
effect you are trying to produce or the problem you are trying to solve, I
might be able to come up with another way of doing it. Maybe someone else
in the group knows a script that can append data though... but it is my
understanding that once the html is written and displayed in the browser,
you can't just write more html to that file on the fly.
Tom Lianza
Carnegie Mellon University
"Justin Dutoit" <justin...@free.net.au> wrote in message
news:eaxUMhC#$GA.56@cppssbbsa05...
I think that for Netscape it could only be accomplished by writing to a DIV
already in the HTML file. But IE provides something besides this approach and
it's called insertAdjacentHTML (I guess...). Take a look at MSDN site to check
version availability and correct syntax.
Klaus