Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139893

Get value of json from api link

$
0
0

i have a api link from a game "https://www.erevollution.com/en/api/citizen/1/"

and i want to get energy value

<!DOCTYPE html>
  <head>
    <title>AutoHit for eRevollution</title>
    <style></style>
 </head>
  <body>

     <button id="button1" class="button button1" onclick="clicked()">Load Battle</button>           
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">

function clicked() { 
var url="https://www.erevollution.com/en/api/citizen/1";

const response = await fetch(url);
const myJson = await response.json();
console.log(JSON.stringify(myJson));
}

    </script>
  </body>
</html>

Viewing all articles
Browse latest Browse all 139893

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>