Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var xmlhttp = new XMLHttpRequest();
  2. xmlhttp.overrideMimeType("application/json");
  3. xmlhttp.onreadystatechange = function() {
  4. if (this.readyState == 4 && this.status == 200) {
  5. var cost = JSON.parse(this.responseText);
  6. document.getElementById('cost').innerHTML = cost[x];
  7. document.getElementById('costwithboard').innerHTML = cost[y];
  8. console.log("test");
  9. }
  10. };
  11. console.log("test")
  12. xmlhttp.open("GET", "colleges.json", true);
  13. xmlhttp.send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement