Link to home
Start Free TrialLog in
Avatar of ka7ana
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.
SOLUTION
Avatar of runa_paathak
runa_paathak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of runa_paathak
runa_paathak

Anyway, your content break problem could be due to some other reason. Browsers can actually recognise empty tags like <tag/> actually.
Avatar of ka7ana

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"></script>
]]>