Here is another json question. The code is the same but for a diferent service. The idea is to fetch the IPs and show to the user by getting the string "ip_str". Also if this is done right is it possible to save every "ip_str" as a individual string that can be called later?
IP: <a id='show'></a>
<script>
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
document.getElementById("show").innerHTML = myObj.matches.ip_str;
}
};
xmlhttp.open("GET", "https://api.shodan.io/shodan/host/searc ... uery=xampp", true);
xmlhttp.send();
</script>
Thanks
I'm a noob i know. If possible include a few references/examples to how Json works.
I have made the adjustments but it doesn't fetch the page. I have tried with two different http servers and check the logs and it isn't nothing there. Do you know what is wrong with?
1. Your Javascript syntax for a function is wrong.
2. There needs to be a space between the "Basic" and the encoded username and password
3. xmlhttp2 is undefined.
4. You don't seem to be passing or receiving any data.