Return to Kroll 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:



 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM