How to display data to the html tag in framework7

29 views Asked by At

I am new in framework7 I want to pass value from an api to html, How am I going to achieve that in framework7, below is what I tried:

app.request
.get("http://127.0.0.1:8000/api/float-amount/" + phone_number, {
}).then(function (res) {
  var data = JSON.parse(res.data);
  var float_amount = data.float_amount;
  document.getElementById("float_amount").innerHTML = float_amount;
  console.log(float_amount);
});

Below is the html part where I want to display the value:

 <div class="item-title item-label" style="margin-top: 5%;" id="float_amount">Balance: 4000</div>
0

There are 0 answers