Bitcoin Wallet address validation using Json and bitcoin/blockexplorer.

0 votes

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. I have written this code but its not working:

function checkAddress(){

  var address = $('#wallet').val();

  $.getJSON('http://blockexplorer.com/q/checkaddress/'+address+'?format=json',{"format":"json"},function(data){

    alert('xxx == '+data);

  });

}

Can someone tell me how to do it?

Aug 20, 2018 in Blockchain by digger
• 26,550 points
172 views

1 answer to this question.

0 votes

The URL isn't returning JSON. So instead of using $.getJSON, use $.get or $.ajax.

function checkAddress(){

  var address = $('#wallet').val();

  $.get('http://blockexplorer.com/q/checkaddress/'+address,function(data){

    alert('xxx == '+data);

  });

}

This should work.

answered Aug 20, 2018 by slayer
• 29,050 points

Related Questions In Blockchain

0 votes
1 answer

How to get all address and send ethers in solidity using a loop?

I found a similar code somewhere: contract  Holders{ uint ...READ MORE

answered Jul 31, 2018 in Blockchain by digger
• 26,550 points
171 views
0 votes
1 answer

Bitcoin: parsing Blockchain API using JSON

Because you only add one address to ...READ MORE

answered Aug 22, 2018 in Blockchain by digger
• 26,550 points
258 views
0 votes
1 answer

Is there a way to send funds from a specific bitcoin address in a wallet?

I'll answer my own question, It was unbelievably ...READ MORE

answered Sep 3, 2018 in Blockchain by Perry
• 17,020 points
68 views
0 votes
0 answers

how to Build Bitcoin address and balance database?

How to build Bitcoin Address and Balance ...READ MORE

Jul 24 in Blockchain by Raj
• 180 points
34 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,550 points
3,073 views
0 votes
1 answer
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,550 points
233 views
0 votes
1 answer

How to generate coin address using bitcoin-ruby?

The only difference between the addresses is ...READ MORE

answered Aug 29, 2018 in Blockchain by slayer
• 29,050 points
58 views
+1 vote
3 answers