Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSubmit(upload_id)
- {
- var xmlhttp;
- var test;
- test =1;
- if (window.XMLHttpRequest)
- {// code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp=new XMLHttpRequest();
- }
- else
- {// code for IE6, IE5
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.open("GET",'/fileupload/progressbar.php?progress_key='+upload_id, false);
- xmlhttp.send();
- xmlhttp.onreadystatechange=function()
- {
- if (xmlhttp.readyState==4 && xmlhttp.status==200)
- {
- if(test=1)
- {
- document.getElementById('progress_number').innerHTML=xmlhttp.getResponseHeader("Percent");
- setTimeout(onSubmit(upload_id), 999);
- }
- else
- {
- document.getElementById('progress_number').innerHTML="Percent more then 100";
- }
- }
- else
- {
- document.getElementById('progress_number').innerHTML="Error: Status Code Not 200";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement