简体   繁体   中英

delay the process time in ajax

I'm doing the progress bar in ajax, jquery with php. I need to delay the uploading process file the file is uploaded. Here is my code.

uploadProgress : function(event, position, total, percentComplete) {
        $("#progressbar").width(percentComplete + '%');     
        $("#percent").html(percentComplete + '%');
        if (percentComplete > 50) {
            $("#message").html("<font color='red'>File Upload is in progress .. </font>");
        }
        },

how can i delay the progress bar loading to show the completed percentage? or is there any other solution?

For testing purposes you can use network throttling in Chrome developer tools (in mobile device emulator mode ). Or any of network throttling tools discussed for example in this offtopic question .

UPD: another topic about network throttling .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM