how do you assign the output of of ocpu.req to a variable in opencpu/javascript -


i trying create self based opencpu app user upload csv file, able chart csv file:

i have code:

$(document).ready(function(){       $("#submitbutton").on("click", function(){          //arguments         var myfile = $("#csvfile")[0].files[0];          if(!myfile){           alert("no file selected.");           return;         }          //disable button during upload         $("#submitbutton").attr("disabled", "disabled");          //perform request         var url;         var req = ocpu.call("readcsvnew", {           file : myfile         }, function(session){           url=session.getloc()+"stdout/text";           //alert(url);           $.getjson(url, function(data) {               console.log(data);           });          }); 

when uncomment alert(url), can see url , accurate. howwever, following not seem working. need assign output of session.loc()+"stdout/text" variable , start manipulating output. however, console.log(data) not producing output. ideas?

var req = ocpu.call("readcsvnew", {               file : myfile             }, function(session){               url=session.getloc()+"stdout/text";               //below line not working. data empty.               $.getjson(url, function(data) {                   console.log(data);               }); 


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -