I get an undefined error and the id is null when running the following code: Geth is running on port 3334 and is running on the rinkeby network. Any ideas why this is failing? the output of running this code is jsonrpc:2.0; id:null; error:[object Object]; code:undefined; message:undefined;
$.ajax({
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
url : "http://localhost:3334",
type : 'POST',
data : {
"jsonrpc":"2.0",
"method":"eth_getBalance",
"params":["0xEa0ce8c5EC357a5C6a1bF4bfC9bfA9acB4896B4e","latest"],
"id":"1"
},
dataType : "json",
success : function(result) {
if (result['result']){
console.log("Balance ="+ result['result']);
}else{
var theText="";
for (property in result) {
theText += property + ':' + result[property]+'; ';
}
console.log(theText);
for (property in result['error']) {
theText += property + ':' + result[property]+'; ';
}
console.log(theText);
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log("error");
}
});