I've put together a JSP page:
<%
int num1 = 10;
int num2 = 20;
%>
<script>
function display(){
var data = new google.visualization.DataTable();
data.addColumn('string', 'Category');
data.addColumn('number', 'Number');
data.addRows([
['category1', <%= num1 %>], ['category2', <%= num2 %>]]);
}
</script>
An issue arises when trying to use these variables within the JavaScript function.
"num1" cannot be recognized as a variable.
"num2" cannot be identified as a variable.