Return to Kroll Web Design home page

JavaScript Tutorials

« Return

splitting a script

It's ok to close the script tag then open it again, at least with the following example:

Code:

<script type="text/javascript">
//<![CDATA[
a = 2;
b = 3;
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
c = a+b;
document.write("c: ", c);
//]]>
</script>

Output:




©2010 Kroll Web Design    davidarthurkroll@verizon.net    781.910.3694