我通过传递参数来调用 JSP,该参数输出有效的 JSON 作为响应,但仍然$.getJson
没有触发回调函数。JSP 页面输出为
{ "data": [ [ [ 1258185480000,4.39],
[ 1258186020000,4.31],
[ 1258184940000,4.39],
[ 1258183560000,4.39] ] ] }
URL 指向 JSP 页面
我的jQuery代码是
<script id="source" language="javascript" type="text/javascript">
$(function () {
alert("before");
$.getJson(URL,function(json){
alert("hello");
var plot = $.plot($("#placeholder"), json.data, options);
});
alert("after");
});