ka7ana
asked on
JSP Parsing Script tag
Hello experts,
I'm writing a webapp using JSP and the Spring Framework. One of my pages makes use of a substantial amount of JavaScript code, which I'm trying to include as an external file using the <script> tag, i.e.
<script language="javascript" src="..."></script>
Unfortunately, this is being parsed and sent to the browser as:
<script language="javascript" src="..." />
Which breaks the content of the page (as the browser is still expecting the closing </script> tag). Does any one have a solution to get round this?
Many thanks,
Darren.
I'm writing a webapp using JSP and the Spring Framework. One of my pages makes use of a substantial amount of JavaScript code, which I'm trying to include as an external file using the <script> tag, i.e.
<script language="javascript" src="..."></script>
Unfortunately, this is being parsed and sent to the browser as:
<script language="javascript" src="..." />
Which breaks the content of the page (as the browser is still expecting the closing </script> tag). Does any one have a solution to get round this?
Many thanks,
Darren.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Anyway, your content break problem could be due to some other reason. Browsers can actually recognise empty tags like <tag/> actually.
ASKER
Ah, sorry - totally forgot to award the points on this question. I did follow a similar method to those posted above, and so I'll split the points evenly between runa_paathak and TimYates. Additionally, I came across this method, which I have started using of late:
<![CDATA[
<script language="javascript" src="myscriptpath.js"></sc ript>
]]>
<![CDATA[
<script language="javascript" src="myscriptpath.js"></sc
]]>