I'd like to output scripts into HTML without knowing whether it's going into a HTML4, HTML5 or XHTML document. The best format I can find is:
<script type="text/javascript">
//<![CDATA[
....any code....
//]]>
</script>
That validates in all three schemes, but will it work in all browsers in all three doctypes?