I'm trying to get server response which is a string literal used to build the table but for some reason I cannot get it to work. I'm getting an error on:
<%--
Document : index
Created on : Nov 14, 2013, 9:49:13 PM
Author : Ronald
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JQuery Ajax Server Call Demo</title>
</head>
<body>
<h2>This will attempt to demonstrate JQuery's ability to submit a server request and response without refreshing</h2>
<input type="button" value="Load Example" onclick="load_page_example();" />
<input type='button' value="Servlet Request" onclick="load_response_example();" />
</body>
<div id='div_processed'></div>
</html>
<script type="text/javascript">
function load_page_example() {
$("#div_processed").load("div_load.jsp");
}
function load_response_example() {
{
text: "parameter"
},
function(data, status) {
loadChart(data);
}
);
}
function loadChart(data){
google.load("visualization", "1", {packages: ['table']});
//google.setOnLoadCallback(drawChart);
var dataresults = google.visualization.DataTable(data.toString(), 0.6);
var options = {
title: 'Company Performance'
};
var table = new google.visualization.Table(document.getElementById('div_processed'));
table.draw(dataresults);
alert("At end of google chart build");
}
</script>