如何使用json将数据表加载到数组 [英] How to load the data table to array using json

查看:125
本文介绍了如何使用json将数据表加载到数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL数据表。它包含两列数据。现在我在j Query中的脚本文件中声明了一个数组。我想将数据表中的数据加载到我的数组中。现在我通过手动给数组赋值。给我一些解决方案。我没有任何想法。



我尝试过:



I have a SQL data table .It contains two columns data.Now I declare an Array in my script file in j Query. I want to load the data from data table to my array . Now am giving value to array by manually.Give me some solution .I don't have any ideas.

What I have tried:

goog = [["6/22/2009", 10], ["6/15/2009", 15], ["6/8/2009", 10], ["6/1/2009", 10], ["5/26/2009", 16],
["5/18/2009", 11], ["5/11/2009",8], ["5/4/2009", 20], ["4/27/2009", 14], ["4/20/2009", 17],
["4/13/2009", 12], ["4/6/2009", 11], ["3/30/2009", 14], ["3/23/2009", 14], ["3/16/2009", 20],
["3/9/2009", 10], ["3/2/2009", 5], ["2/23/2009", 9], ["2/17/2009", 9], ["2/9/2009", 11],
["2/2/2009", 12]];
 plot1 = $.jqplot('chart1', [goog], opts);

推荐答案

.jqplot(' chart1',[goog],opts);
.jqplot('chart1', [goog], opts);


您可以使用Ajax GET来填充JSON中的数据。 AJAX可以调用方法或web服务后面的一些代码来获取数据。
You can use Ajax GET to fill data in you JSON. AJAX can call some code behind method or webservice to get data.


这篇关于如何使用json将数据表加载到数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆