Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

assigning return value of a javascript function to a variable

843840Aug 27 2008 — edited Aug 27 2008
hi.
I have a javascript function which returns string.
I wanna assing return value of that function to variable.
for example:

<script>
funtion writeMe()
{
var ex;
ex="try"
return ex;
}
</script>

Then in body of JSP page. I wanna do something like:

<% String st;%>

Now I wanna assign the value that returned from writeMe function ("try") to st string.like:

<%st= writeMe();%>. but of course it doesn't work. how can I do that?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2008
Added on Aug 27 2008
2 comments
105 views