aspose file tools
The moose likes JSP and the fly likes Problem with closing script tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Problem with closing script tag" Watch "Problem with closing script tag" New topic
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
    
  13

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem with closing script tag
 
Similar Threads
generate id attribute of <p> tag dynamically
Problem with script tag
setting value for hidden tag
Jsp & JavaScript
How to get the managed bean property value inside the javascript method in facelets?