goshod/html/js/shodan_utils.js
2022-05-17 22:06:56 +05:30

25 lines
No EOL
743 B
JavaScript

function shodanSearch(){
searchbar = document.getElementById("search").value;
search = document.getElementById("search").value;
console.log("Executing shodanSearch ...")
console.log(searchbar)
var xhttp = new XMLHttpRequest();
var url = '/shodansearch';
xhttp.open("POST", url, true);
xhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var response_body="";
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Typical action to be performed when the document is ready:
response_body = xhttp.responseText
console.log(response_body);
}
};
xhttp.send("search="+search);
}