jquery - $.getJSON is not fully working -
i have simple java-script method call code behind using $.getjson.
function gettrainingresults(id){ $.getjson("/dashboard/gettrainingresults/", null, function(data) { return data; }); }
and conroller method
public actionresult gettrainingresults() { string test = "you there."; return json(test, jsonrequestbehavior.allowget); }
its being called. cant data.it returns null. note : how pass paremeter.
thanks
you have use callback return value ajax request.
something :
function gettrainingresults(id, callback){ $.getjson("/dashboard/gettrainingresults/", null, callback); }
call example :
gettrainingresults(yourid, function(data) { alert(data); });
Comments
Post a Comment