0
votes

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 enter image description here I dont know why this is happening!

I am trying to get the wallet balance and im expecting a str value.

1

1 Answers

0
votes

Ok guys sorry for wasting your time. I read the docs for the function and i was parsing it wrong. I was using an outdated function that has many errors.