Bitcoin Forum
May 08, 2024, 03:21:25 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Check address balance with JavaScript?  (Read 1265 times)
JetRX (OP)
Jr. Member
*
Offline Offline

Activity: 57
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
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
hexafraction
Sr. Member
****
Offline Offline

Activity: 392
Merit: 259

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: 1003



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: 104


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:  

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