I have this java code in jsp page ::
<%
String temp1;
PopulateTextbox obj = new PopulateTextbox();
temp1 = obj.method();
%>
And on the same jsp page i have javascript code ::
<script type="text/javascript">
var storedata={
identifier:"table1",
label:"name",
items: temp1
};
var gridStructure =[{
cells:[
[
{ field: "ID",
name: "ID_Emp",
width: "40%", styles: 'text-align: right;'
},
{
field: "Names",
name: "Name",
width: "40%", styles: 'text-align: right;'
}
]
]
}];
</script>
Now here temp1 is common. I want that the variable temp1 can be passed on to or javascript code. how to do that ? thanks.
var jsTempValue = "<%= temp1 %>";