JavaScript Firefox workaround

Because of a security reason (thanks, Asa), Firefox does not like script elements in the style:

<script type="text/javascript" src="jquery-1.2.3.js" />
<script type="text/javascript" src="jquery.cookie.js" />

Safari handles this correctly, however Firefox seems to only load the first one and ignores the second. The doctype is XHTML 1.0 Strict, so this should be technically valid XML.

The workaround for this is to open and close the tags:

<script type="text/javascript" src="jquery-1.2.3.js"></script>
<script type="text/javascript" src="jquery.cookie.js"></script>

I’ve updated my Dynamic Form Example to reflect this workaround.

1 Response to “JavaScript Firefox workaround”


  1. 1 Asa Dotzler

    It’s actually not a bug, but a bug fix that changed this behavior. It was causing compatibility and security problems. See Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=305873

Leave a Reply