2018-06-29 00:42:04 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script src="../../static/jquery-2.0.3.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2019-05-10 00:51:44 +00:00
|
|
|
<script>
|
|
|
|
window.ajax = (url, options) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
options.url = url
|
|
|
|
options.success = (data, status, request) => {
|
|
|
|
resolve({data, status: request.status, headers: request.getAllResponseHeaders()})
|
|
|
|
}
|
|
|
|
options.error = (xhr, errorType, error) => {
|
2019-06-19 20:40:49 +00:00
|
|
|
reject(error ? error : new Error(`${xhr.status}`))
|
2019-05-10 00:51:44 +00:00
|
|
|
}
|
|
|
|
$.ajax(options)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
2018-06-29 00:42:04 +00:00
|
|
|
</body>
|
|
|
|
</html>
|