Bitcoin Forum
December 14, 2024, 08:41:54 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: не срабатывает опрос blockchain JSON  (Read 1207 times)
promankirov (OP)
Full Member
***
Offline Offline

Activity: 181
Merit: 101


View Profile
March 15, 2013, 03:54:43 PM
 #1

Помогите.
Не могу понять почему не срабатывает опрос blockchain JSON
Пример html кода:
Code:
<html>
<head>
<title>final_balance</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script>
$(document).ready(function() {   
jQuery.getJSON(
"http://blockchain.info/address/1Dy653qDGdrshqi6exaDQrUsmQ71fhgfjb?format=json",
function(data){
$("#test").text(data.final_balance);
}
);
});

</script>
</head>
<body>
 
JSON
 
<div id="test"></div>
</body>
</html>

Аналогичный код работает:
Code:
<html>
<head>
<title>generator</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script>
$(document).ready(function() {   
jQuery.getJSON(
"http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",
function(data){
$("#test").text(data.generator);
}
);
});

</script>
</head>
<body>
 
JSON
 
<div id="test"></div>
</body>
</html>
panic
Sr. Member
****
Offline Offline

Activity: 442
Merit: 260


View Profile WWW
March 16, 2013, 06:34:49 AM
 #2

потому что XSS.

вот так работает:
Code:
<html>
<head>
<title>final_balance</title>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
<script>

$(document).ready(function(){

request=$.ajax({
type: "GET",
url: "http://blockchain.info/q/addressbalance/1Dy653qDGdrshqi6exaDQrUsmQ71fhgfjb?confirmations=6",
dataType: "text",
success: function(data){
$("#test").text(data);
}
});

});

</script>
</head>
<body>
 
TEXT
 
<div id="test"></div>
</body>
</html>


...too much panic and too little reason
promankirov (OP)
Full Member
***
Offline Offline

Activity: 181
Merit: 101


View Profile
March 16, 2013, 08:36:44 AM
 #3

спасибо
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!