I was wondering what the difference between declaring a function like this:
<SCRIPT>
function afunc(){
x1 = 0;
//stuff goes here
}
</SCRIPT>
and like this:
<%!
public afunc(){
x2 = 0;
//stuff goes here
}
%>
Also, what is the scope of x1 and x2?
I am trying to access a variable that is similar to x1, somewhere (outside the script tags of x1) in the same .jsp file inside a pair of <% %>
and I am not able to do so (probably due to scope problems).
Thanks!