Bitcoin Forum
September 27, 2018, 10:56:06 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Check address balance with JavaScript?  (Read 1142 times)
JetRX
Member
**
Offline Offline

Activity: 60
Merit: 10


View Profile WWW
August 15, 2015, 05:53:19 PM
 #1

How to do it?

— ApsMoney.com - Oбмeн Bitcoin, PM, Payeer,BTC-e, Пpивaт24
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
hexafraction
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250

Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ


View Profile
August 15, 2015, 11:36:05 PM
 #2

Both blockchain.info and blockr.io have APIs you can use for this purpose. You can load https://blockchain.info/address/{ADDRESS HERE}?format=json or http://btc.blockr.io/api/v1/address/info/{ADDRESS HERE} using AJAX and parse the JSON.

I have recently become active again after a long period of inactivity. Cryptographic proof that my account has not been compromised is available.
Kazimir
Legendary
*
Offline Offline

Activity: 1176
Merit: 1000



View Profile
August 16, 2015, 05:01:50 AM
 #3

Both blockchain.info and blockr.io have APIs you can use for this purpose. You can load https://blockchain.info/address/{ADDRESS HERE}?format=json or http://btc.blockr.io/api/v1/address/info/{ADDRESS HERE} using AJAX and parse the JSON.
Ajax doesn't allow you to make requests to another domain. So if your site is on example.com, your javascript can't query an external URL like btc.blockr.io.

In theory, there's no difference between theory and practice. In practice, there is.
Insert coin(s): 1KazimirL9MNcnFnoosGrEkmMsbYLxPPob
luisan00
Full Member
***
Offline Offline

Activity: 187
Merit: 100


View Profile
August 16, 2015, 09:50:36 AM
 #4

Quote
Ajax doesn't allow you to make requests to another domain. So if your site is on example.com, your javascript can't query an external URL like btc.blockr.io.
What?? Huh Huh
Today, cross domain Ajax request is supported for major browsers.
You can use several resources for a request cross domain , for example: JSONP, OpenAjax Hub, easyXDM, etc, also proxified petitions can help, or simply type in google CORS, cross domain, etc etc.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!