Im making a cryptocurrency using python,html,and javascript. I have everything working but a balance checker. Im using the same method for the balance checker that i used for every other service in my app. I dont know why this happens but it gets the data that works but then it just displays nothing. Code for getting data(javascript):
function getbal(){
var address=document.getElementById("address").value;
let xhr = new XMLHttpRequest();
xhr.open('GET', '/wallet/getbalance?address='+address);
xhr.send();
raw=xhr.responseText;
data=raw;
alert(data)
return data;
};
GET url response is 200 and it shows 1.0 I dont know why this is happening!
I am trying to get the wallet balance and im expecting a str value.