mavigozler;1084011 wrote:Really, your TEACHER says that the method document.write() works in XHTML documents???
Yes document.write() does work in XHTML while the page is loading.
I use
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/URL]">
<html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
on all my web pages and I use something like
document.write('<a title="Click to write and send me an email." href="'+part10+part4+'">'+partsSum+'</a>');
on my 'contact' page to display my email address but hide it from bots and email address harvesters.
The above document.write() works fine without any problems.
Another example. You will find that this XHTML page also works and displaye "Hello World".
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
document.write("<p>Helo World..!!<p>");
</script>
</body>
</html>
fyi - I am not his/her teacher 