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.

4

You are trying to cross domains.

Look into jsonp for that:

  • Don't cross the streams! – ripper234 Sep 11 '12 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.