0
我有一個按鈕,這個按鈕的onclick事件我正在調用一個ajax函數,它將一個jsp頁面的內容包含到一個DIV中。在JSP頁面上,我正在查詢數據庫並在ResultSet中獲取數據,這些數據我想在同一個JSP頁面上的表和圖中顯示,表I可以直接在同一頁中創建,但是如何將數據傳遞給java繪製圖表的腳本。這是我的ajax函數:從jsp發送ResultSet數據到javascript
$.ajax({
url: url,
type: 'POST',
data: symbol,
success: function(data) {
//data contain content of JSP page which also contain ResultSet and also a div element in which i want to show graph
var content =data;
//this is adding content into a div element.
$('#tt').tabs('add',{
title:title,
content:content,
closable:true
});
//here i am looking to write the code for plotting graph.
var myLine = new Chart(document.getElementById("myChart").getContext("2d")).Line(lineChartData);
},
error: function(e) {
alert("error : "+e);
//called when there is an error
//console.log(e.message);
}
});