2014-03-04 23:01:53 +00:00
|
|
|
function postInfo(path, data, cb) {
|
2013-11-02 19:52:50 +00:00
|
|
|
var xmlHttp = new XMLHttpRequest();
|
2013-10-31 18:55:22 +00:00
|
|
|
|
|
|
|
if (xmlHttp.overrideMimeType) {
|
|
|
|
xmlHttp.overrideMimeType("text/plain; charset=x-user-defined");
|
|
|
|
}
|
|
|
|
|
2014-03-04 23:01:53 +00:00
|
|
|
xmlHttp.open('POST', path, !!cb);
|
|
|
|
|
|
|
|
if (cb) {
|
|
|
|
xmlHttp.onreadystatechange = function() {
|
|
|
|
if (xmlHttp.readyState == 4) { cb.apply(this, arguments); }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-10-31 18:55:22 +00:00
|
|
|
xmlHttp.send(data);
|
2014-03-06 17:48:54 +00:00
|
|
|
return xmlHttp;
|
2014-03-03 01:47:24 +00:00
|
|
|
}
|