RE: Getting Json request to work 04-09-2018, 06:22 PM
#7
(04-09-2018, 06:02 PM)hacxx Wrote: I tried different variations and it didn't show anything in the screen
Here is the latest test
Code:<script> var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var myObj = JSON.parse(this.responseText); document.write('<center><table><tr><td>'); for (x in myObj) { document.write(''+ myObj.[x].ip +'<br>'); } document.write('</td></tr></table></center>'); } }; xmlhttp.open("GET", "https://www.cpalead.com/dashboard/reports/leads_api.php?id=210923&token=042A598ADFC1A4FBEC&cpc=1", true); xmlhttp.send(); </script>
change
Code:
document.write(''+ myObj.[x].ip +'<br>');Code:
document.write(''+ myObj[x]["ip"] +'<br>');
(This post was last modified: 04-09-2018, 06:23 PM by Pikami.)











![[Image: 9H83e18.png]](https://i.imgur.com/9H83e18.png)
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)