1
<script type="text/javascript">
$('x').load("https://blockchain.info/q/getreceivedbyaddress/1Pt9TRJKeAW61aR1ELQpUZKdMaYXzkCTrn",function(){
var formatted_value=$('x').text();//$('**x**') is selector for the 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>
的查詢中使用它發送其被用於填充計的數目。如何將收到的值分配給var formatted_value?
它現在有效。該代碼是:
<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**') is selector for the class
var goalGauge = new Gauge();
goalGauge.draw(formatted_value);
});
</script>
這並不工作。 – user2349327 2013-05-04 08:30:25
我已經改變了上面的代碼與全Sript請檢查並告訴其正確 – user2349327 2013-05-04 08:31:00
x是什麼?它在html中無處可用。 – specialscope 2013-05-04 08:37:58