<script> function getValue(){ document.form1.brief.value = '<%=briefstr %>'; } </script>
where "brief" is a hidden variable and "briefstr" is a Java String variable and consists of javascript contents. when javascript inside value closes, that </script> tag closes script in my jsp file and gives javascript Error I need to assign these value onload of body for rest of the cose. How can i handle it?
onload event is fired when the body of the content is being loaded, yet still not completed. So there is a possiblity to get the script since the hidden variable is still yet to be drawn.
You can you onreasystatechange event handler on the document object and then check for readystatechange property for completeness.
If this has to loaded when the document is loaded you can directly the value of briefstr to the hidden variable.