jquery - assign query result to variable and use it in javascript -


 <script type="text/javascript"> $('x').load("https://blockchain.info/q/getreceivedbyaddress/1pt9trjkeaw61ar1elqpuzkdmayxzkctrn",function(){   var formatted_value=$('x').text();//$('**x**') selector class   var goalgauge = new gauge();   goalgauge.draw(formatted_value);  }); </script> <canvas id="gauge" width="240" height="240" style="display: block; width: 240px; margin: 0px auto;"></canvas></div> 

the query sends number used fill gauge. how assign received value var formatted_value ?

it works now. code is:

<div style="width: 100%; float: left;">  <div id="x"></div> <canvas id="gauge" width="240" height="240" style="display: block; width: 240px; margin: 0px auto;"></canvas> </div> <script type="text/javascript"> $('#x').load("https://blockchain.info/q/getreceivedbyaddress/1pt9trjkeaw61ar1elqpuzkdmayxzkctrn", function () { var formatted_value = $('#x').text(); //$('**x**') selector class var goalgauge = new gauge(); goalgauge.draw(formatted_value); }); </script> 

load async so,

$('**x**').load("https://blockchain.info/q/getreceivedbyaddress/********",function(){       var formatted_value=$('**x**').text();//$('**x**') selector class       var goalgauge = new gauge();       goalgauge.draw(formatted_value);  }); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -