Wednesday, 27 May 2020

Bring Data to HTML using D3 JS

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>HTML Data</title>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.js'></script>
</head>
<body>
  <script>
  function GetData() {
 
fetch('https://jsonplaceholder.typicode.com/todos')
  .then(response => response.json())
  .then(json=> d3.select("div")
.selectAll("p")
.data(json)
.enter()
.append("p")
.text(d => d.title));
  }
  GetData();
  </script>
 
  <h1>Hello World</h1>
  <div></div>
</body>
</html>

No comments:

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex