Errrrrrrr... first off language="JavaScript" needs to go. That's not
even JavaScript anymore...
Secondly, document.write dies MANY years ago. I would highly suggest
you learn DOM programming.
Third, check the content type IIS is sending the thing as. It may be
sending it as something stupid.
agapeton@gmail.com said the following on 9/28/2006 11:00 PM:
> Errrrrrrr... first off language="JavaScript" needs to go. That's not
> even JavaScript anymore...
It never was Javascript to start with. It is an HTML attribute.
> Secondly, document.write dies MANY years ago. I would highly suggest
> you learn DOM programming.
That's idiotic. Sure, there are other ways to do it, but sometimes
document.write is just the simplest way.
> Third, check the content type IIS is sending the thing as. It may be
> sending it as something stupid.
And you think IE pays attention to content type? It tries to render
anything and everything.
Fourth, and most importantly, make sure you don't have a path/filename
collision.
Fifth, ignore idiotic top-posters.

Signature
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
> Errrrrrrr... first off language="JavaScript" needs to go. That's not
> even JavaScript anymore...
Please don't top-post, reply below trimmed quotes.
The language attribute never was part of JavaScript, it was introduced
as a deprecated attribute in HTML 4.
> Secondly, document.write dies MANY years ago.
I doubt that you can find a visual UA with script support that doesn't
support it.
> I would highly suggest you learn DOM programming.
Considering document.write() is a method of the document object, it
*is* "DOM programming".
> Third, check the content type IIS is sending the thing as. It may be
> sending it as something stupid.
I suppose you are referring to the possibility that the document is
being served as XHTML. In that case, document.write won't work - but
there is nothing to indicate that is the case.
> > The script below loads a calendar page in an iframe and scrolls to
> > today's date.
[quoted text clipped - 12 lines]
> > <script language="JavaScript" type="text/JavaScript">
> > <!--
Do not use HTML comments inside script elements, they are unnecessary.
> > var date = new Date();
> > var d = date.getDate();
[quoted text clipped - 3 lines]
> > var yy = date.getYear();
> > var year = (yy < 1000) ? yy + 1900 : yy;
Better to use getFullYear() unless very old browser support is
required. Have you considered an "add leading zero" function?
function addZ(num){ return (num<10)? '0'+num : num;}
> > document.write
> > ("<iframe name=\"Calendar\" width=\"215\" marginwidth=\"0\"
[quoted text clipped - 3 lines]
> > src=\"calendar.htm#" +
> > month + day + year
That seems an inappropriate choice of date format, why not use an ISO
format? Say yyyymmdd? Using addZ(), you can generate the date string
as:
var d = new Date();
document.write(
'<iframe ...
+ ' src="calendar.htm#' + d.getFullYear()
+ addZ(d.getMonth()+1) + addZ(d.getDate()+1)"'
);
> + "\"");
You don't seem to have properly closed the element, where is the
'></iframe>' string?
> //-->
> </script>

Signature
Rob