JSFiddle - React, Tailwind, and code Playground

by leiperte

HTML

<!--Assignment 6 - JSON and JQuery-->
<html>
<head>
<center><h1>
Speicies That Appear to Never Age!
</h1></center>
</head>
<body>
<p id="demo">
</p>

<script>
var obj, dbParam, xmlhttp, myObj, x, txt = "";
obj = {table:"longevity", limit:7};
dbParam = JSON.stringify(obj);
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
	if (this.readyState == 4 && this.status == 200){
  	myObj = JSON.parse(this.responseText);
    txt += "<table border='1'>"
    for (x in myObj){
    	txt += "<tr><td>" + myObj[x].name + "</td></tr>";
    }
    txt += "</table>"
    document.getElementById("demo").innerHTML = txt;
  }
};
xmlhttp.open("POST", "https://jsonlint.com/?json=%7B%22hello%22:%20%22world%22%7D", true);
xmlhttp.setResponseHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("x=" + dbParam);
</script>
</body>
</html>