|
-
May 16th, 2012, 01:41 AM
#1
JSP / Javascript
I want to use a variable's value which i am getting through resultset from database in jsp scriptlets in my javascipt code .
i want to display that variable in javascript .
or if you can suggest me how can i use javascript inside scriptlets
-
May 16th, 2012, 09:38 AM
#2
Re: JSP / Javascript
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
May 16th, 2012, 09:41 AM
#3
Re: JSP / Javascript
Just output the variable inside of <script> tags.
Code:
<script type="text/javascript">
var jspVariable = "<%=jsp_variable %>";
</script>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
May 18th, 2012, 10:53 AM
#4
Re: JSP / Javascript
No that won't help in my case
My case is like this
Javascript{
I want to use that object in this javascript
}
<%
there is my resultset object
%>
-
May 18th, 2012, 03:48 PM
#5
Re: JSP / Javascript
Yes it will. You're forgetting that JSP is server side and will output before the page is executed on the JavaScript side.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|