I want to use scriplets inside a javascript function. And inside the scriplet i want to make use of a javascript variable. How can i access javascript variable inside the scriplets?
code:
<script>
window.onload = function(e)
{
arr = $('#hidden_field').val();
arr = JSON.parse(arr);
for(var i=0;i < arr.length;i++){
<% SomeClass class = doSomething(arr[i]);
%>
}
}
</script>
I want to pass the arr[i] value to the doSomething function and get some result. How can i do this?