I am looking to import JavaScript code into my JSF page. I did so just as you'd expect:
<script type="text/javascript" src="js/imports.js"></script>
Please notice that I closed the script tag explicitly because I know IE wouldn't recognize it otherwise.
However, I found that after processed by the FacesServlet, the script tag ends up looking like this anyway:
<script type="text/javascript" src="js/imports.js" />
Therefore, the script is nonexistent as far as IE is concerned. I applied a very ugly hack to solve the problem:
<f:verbatim>
<script type="text/javascript" src="js/imports.js"></script>
(I got rid of semicolons after the escape characters so things would appear properly on here.)
It works in IE, but I totally hate it. Is there anything more elegant I can do, short of rewriting the FacesServlet, to have it process the import with the closing tag?
Thanks for any insight.