Author

Topic: Can I call the blockchain.info API with just javascript or jQuery? (Read 704 times)

member
Activity: 99
Merit: 10
@coretechs
I've tried a lot of variations and nothing seems to work. I still get this in the console:

Quote
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://blockchain.info/unspent?active=1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC&cors=true. This can be fixed by moving the resource to the same domain or enabling CORS.
donator
Activity: 362
Merit: 250
You need to use an ampersand for query parameters: "&cors=true"

ex -
Code:
$.getJSON("http://blockchain.info/unspent?active=1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC&cors=true", function (data) { alert(JSON.stringify(data)); });
member
Activity: 99
Merit: 10
Can I call the blockchain.info API with just javascript or jQuery?

I'm trying to load http://blockchain.info/unspent?active=$address. From what i've read it should be possible somehow with cors, but i've been checking urls with this cors test: http://client.cors-api.appspot.com/client, and with or without the "?cors=true" i'm not having much luck.

Has anyone got this to work?
Jump to: