face-recognition.js/public_html/js/lib/min/permanent-storage.js

4 lines
812 B
JavaScript

var PermanentStorage=function(){};
PermanentStorage.prototype={store:function(a,c){var d,b;a=a||null;a="string"===typeof a?a:null;if(!(a&&c instanceof Function))return!1;d=new FormData;d.append("data",a);b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHttpRequest");b.addEventListener("readystatechange",function(a){b.readyState-4||!~[0,200].indexOf(b.status)||c.bind(b.responseText)},!1);b.open("POST","./permanent-storage/",!0);b.send(d)},fetch:function(){var a;if(!(callback instanceof Function))return!1;a=
window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHttpRequest");a.addEventListener("readystatechange",function(c){a.readyState-4||!~[0,200].indexOf(a.status)||callback.bind(a.responseText)},!1);a.open("POST","./permanent-storage/",!0);a.send(null)}};