Author

Topic: Check address balance with JavaScript? (Read 1293 times)

full member
Activity: 187
Merit: 104
August 16, 2015, 04: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.
legendary
Activity: 1176
Merit: 1011
August 16, 2015, 12: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.
sr. member
Activity: 392
Merit: 268
Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ
August 15, 2015, 06: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.
jr. member
Activity: 57
Merit: 10
August 15, 2015, 12:53:19 PM
#1
How to do it?
Jump to: