83nini
15 years ago
Hi all,
I'm an absolute beginner in JQuery, and i need your kind help on
this...
i have an mvc project in asp.net, visual studio 2010
i added the jquery.js and jquery.flot.js files in the master page,
then i went to HomeController.cs and wrote the following method:
public ActionResult Example()
{
string s = "[[2003,10882],[2002,10383],[2001,10020],
[2000, 9213]]";
return Json(s, JsonRequestBehavior.AllowGet);
}
as you see i'm trying to get json object..
so in the Index.aspx i wrote the following javascript code
$(function () {
$.getJSON("../../Home/JsonValues/", function (data) {
var plotarea = $("#plot_area");
$.plot(plotarea, data);
});
});
problem is i'm getting an empty graph, i.e. data = null
i'm tracing with the firebug, and seems the problem is context =
undefined!
how do i solve this?
i've been googling the whole morning but in vain!!!
I'm an absolute beginner in JQuery, and i need your kind help on
this...
i have an mvc project in asp.net, visual studio 2010
i added the jquery.js and jquery.flot.js files in the master page,
then i went to HomeController.cs and wrote the following method:
public ActionResult Example()
{
string s = "[[2003,10882],[2002,10383],[2001,10020],
[2000, 9213]]";
return Json(s, JsonRequestBehavior.AllowGet);
}
as you see i'm trying to get json object..
so in the Index.aspx i wrote the following javascript code
$(function () {
$.getJSON("../../Home/JsonValues/", function (data) {
var plotarea = $("#plot_area");
$.plot(plotarea, data);
});
});
problem is i'm getting an empty graph, i.e. data = null
i'm tracing with the firebug, and seems the problem is context =
undefined!
how do i solve this?
i've been googling the whole morning but in vain!!!