metasploit-framework/data/js/network/ajax_post.js

23 lines
530 B
JavaScript
Raw Normal View History

2013-10-31 18:55:22 +00:00
function postInfo(path, data) {
var xmlHttp = '';
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else {
2013-10-31 21:09:05 +00:00
var objs = ["Microsoft.XMLHTTP", "Msxml2.XMLHTTP", "Msxml2.XMLHTTP.4.0"];
for (var i=0; i < objs.length; i++) {
try {
xmlHttp = new ActiveXObject(objs[i]);
break;
}
catch (e) {}
}
2013-10-31 18:55:22 +00:00
}
if (xmlHttp.overrideMimeType) {
xmlHttp.overrideMimeType("text/plain; charset=x-user-defined");
}
xmlHttp.open('POST', path, false);
xmlHttp.send(data);
}