Dev: Sources

This commit is contained in:
surunzi
2016-05-09 11:54:48 +08:00
parent 6f2b4b31c9
commit 18e2ff8910
8 changed files with 166 additions and 66 deletions

19
eustia/get.js Normal file
View File

@@ -0,0 +1,19 @@
function exports(url, cb)
{
var xhr = new window.XMLHttpRequest();
xhr.onload = function ()
{
var status = xhr.status;
if ((status >= 200 && status < 300) || status === 304)
{
cb(null, xhr.responseText);
}
};
xhr.onerror = function () { cb(xhr) };
xhr.open('GET', url);
xhr.send();
}