pass jsp variable to javascript code example
Example: how to pass java variable to javascript function in jsp
<% String str="Hello World"; %>
<html>
<head>
<script language="javascript">
function access(){
var s="<%=str%>";
alert(s);
}
</script>
</head>
<body onload="access()">
</body>
</html>