Why does calling BlockExplorer's checkaddress JSON API do nothing?

5

I need some help with using JSON and the bitcoin / blockexplorer json calls. I'm not even sure if this is going to work. Basically I'm trying to validate a bitcoin wallet address. I want it to check against the blockexplorer to see if it's a "valid" address or not.

Here's what I've done so far:

function checkAddress(){
  var address = $('#wallet').val();
  $.getJSON('http://blockexplorer.com/q/checkaddress/'+address+'?format=json',{"format":"json"},function(data){
    alert('xxx == '+data);
  });
}

But it doesn't seem to be doing anything at all.. Is it even possible for me to use the blockexplorer with JSON to get the results? I'm incredibly new to bitcoin and I'm not entirely sure what I'm doing.

SoulieBaby

Posted 2012-09-10T01:29:17.410

Reputation: 153

Answers

4

You are trying to cross domains.

Look into jsonp for that:

Stephen Gornick

Posted 2012-09-10T01:29:17.410

Reputation: 26 118

Don't cross the streams!ripper234 2012-09-11T13:00:22.220