function getTitle(url, cb, bool_arg) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "./headers.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
cb(url, xhr.responseText, bool_arg);
}
};
var data = "f=post&u=" + encodeURIComponent(url);
xhr.send(data);
}
{
jQuery.ajax
({
url: "./headers.php",
type: "post",
data:
{
f : "post",
u : url
},
success: function(response)
{
cb(url, response, bool_arg);
}
});
}