Last active
August 29, 2015 14:06
-
-
Save pzread/9c9b756f0a29683f78a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
'url':'/judge/api/' + api_key + '/add_pkg', | |
'type':'POST', | |
'data':pkg, | |
'cache':false, | |
'processData':false, | |
'contentType':false, | |
'xhr':function(){ | |
var xhr = new XMLHttpRequest(); | |
xhr.upload.addEventListener('progress',function(e){ | |
var prog = Math.min(100,e.loaded / pkg.size * 100); | |
j_bar.css('width',prog + '%'); | |
}); | |
return xhr; | |
}, | |
'success':function(res){ | |
j_result_spin.hide(); | |
j_result.text(JSON.stringify(res,null,' ')); | |
j_result.show(); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment