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
Printable View
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
[ moved thread ]
Just output the variable inside of <script> tags.
Code:<script type="text/javascript">
var jspVariable = "<%=jsp_variable %>";
</script>
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
%>
Yes it will. You're forgetting that JSP is server side and will output before the page is executed on the JavaScript side.