Как передать значения из json в другую функцию
Может код тугой, но я ВООБЩЕ новичек. Код javascript
App = function(){ var ajaxStack = []; this.pushAjaxResult = function(ajaxResult) { ajaxStack.push(ajaxResult); } this.getLastAjaxResult = function() { return ajaxStack[ajaxStack.length - 1]; } }; app = new App(); $.get('/testo.php',function(Arr){ var x = JSON.parse(Arr); app.populateTable(x); } ,"json") app.populateTable = function(x) { var buf =[]; for (var i = 0;i<x.length;i++){ buf[i]=[i,x[i]]; } }; Необходимо передать в функцию plot массив buf plot = $.plot($("#placeholder"), [ { data: buf .... }); |
Часовой пояс GMT +3, время: 05:17. |