How can i add ‘javascript’ variable in javascript function with ‘jsp’ variable
example:
function s(){
var count=1;
<%
int i=0;
i(‘jsp’ variable)+count(‘javascript’ variable)
%>
}
My next problem specification is in my bellow code.In this code i want to execute a ‘jsp’ loop instead of ‘javascript’ loop.please help me quickly.
/////////////////code//////////////
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<%
String n=”shanto”;
String n1=”bos”;
%>
<body>
<form name=”form1″ >
<p>
<select name=”select1″ onChange=”change()”>
<option value=”12″>hi</option>
<option value=”12″>i</option>
</select>
</p>
<p>
<select name=”select2″>
</select>
</p>
</form>
</body>
</html>
<script language=”JavaScript”>
var count=1;
function change(){
///////////////// Problem /////////////
for(var i=0;i<3;i++){//here i want to execute ‘jsp’ loop instead of ‘javascript’ loop//
if(count%2==0)
document.form1.select2.options[i]=new Option(“<%=n1%>”,”<%=n%>”,false,false);
else
document.form1.select2.options[i]=new Option(“<%=n%>”,”<%=n%>”,false,false);
}
count++;
}
</script>