[thelist] xmtml and internal javascript

Tom Dell'Aringa pixelmech at yahoo.com
Sat Aug 17 20:31:01 CDT 2002


Hey all,

I know that javascript must be external like css in XHTML files. I
came across this statement that said you can include internal JS in
XHTML if you enclose it in a character data (cdata) block like so:

<script language="JavaScript">
<!-- <![CDATA[
document.write("<h2>Table of Factorials</h2>");
for(i = 1, fact = 1; i < 10; i++, fact *= i) {
document.write(i + "! = " + fact);
document.write("<br />");
}
]]> -->
</script>

Have any of you done this and does it validate?

Tom


=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com



More information about the thelist mailing list