Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JSON HTML

const dbParam = JSON.stringify({table:"customers",limit:20});
const xmlhttp = new XMLHttpRequest();
xmlhttp.onload = function() {
  myObj = JSON.parse(this.responseText);
  let text = "<table border='1'>"
  for (let x in myObj) {
    text += "<tr><td>" + myObj[x].name + "</td></tr>";
  }
  text += "</table>"
  document.getElementById("demo").innerHTML = text;
}
xmlhttp.open("POST", "json_demo_html_table.php");
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("x=" + dbParam);
Comment

html working with JSON data

superHeroes.homeTown
superHeroes['active']
Comment

html working with JSON data

superHeroes['members'][1]['powers'][2]
Comment

PREVIOUS NEXT
Code Example
Javascript :: enable javascript chrome 
Javascript :: javascript promise with ajax 
Javascript :: highest and lowest javascript 
Javascript :: Why my array resets itself when I leave my function 
Javascript :: get html 
Javascript :: binary search tree js 
Javascript :: fastest way to check a number is palindrome 
Javascript :: array reduce javascript 
Javascript :: express nodejs 
Javascript :: react scroll animation 
Javascript :: javascript promise async 
Javascript :: sample promise.all javascript 
Javascript :: do while loop javascript 
Javascript :: laravel json eloquent 
Javascript :: javascript loading animation on button click 
Javascript :: hoisting in javascript mdn 
Javascript :: buffer concat nodejs 
Javascript :: split javascript 
Javascript :: insert a data into mongo using express 
Javascript :: gettimezoneoffset javascript 
Javascript :: react animations 
Javascript :: belongstomany sequelize 
Javascript :: how to set three js canvas width 100% 
Javascript :: javascript inheritance 
Javascript :: how to use hash in javascript 
Javascript :: JavaScript Access Elements of an Array 
Javascript :: react npm start not working 
Javascript :: middleware in express 
Javascript :: javascript format a date 
Javascript :: trim function 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =