| Author |
Problem with closing script tag
|
Anup Srivastava
Greenhorn
Joined: Dec 21, 2005
Posts: 21
|
|
I am trying to perform following operation <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?
|
 |
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
|
|
You can not, simply. JavaScript runs on client side, on the other hand JSP is a server-side technology.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
and "briefstr" is a Java String variable and consists of javascript contents.
Do you not thing it might help to show us what that is?
I need to assign these value onload of body for rest of the cose.
"cose"? What's a "cose"?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
seby mathew
Greenhorn
Joined: Apr 19, 2006
Posts: 7
|
|
|
remember one thing 'briefstr' is a server side variable, means this is a java variable and it gets initialised in server side, so you have to write some method to manipulate the server side variable (like replace '>' with '>') so that it wont affect your html rendering of the jsp.
|
 |
 |
|
|
subject: Problem with closing script tag
|
|
|