is it possible to make real time progress/percentage bar in jquery -
below code simple jquery progress bar. there way update progress value (that 67 rite now)dynamically on ajaxstart , reach value 100 on ajaxstop()?
<head><script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script>$(function() { $( "#progressbar" ).progressbar({ **value: 67** }); }); </script> </head> <body> <div id="progressbar"></div> </body>
if targetting html5 browsers only, try whats decribed here:jquery ajax progress in html5
the traditional way go show spinning gif, instead of loader.
ajax request wont long in of cases & hence effort in trying same lost.
however not uncommon progress bar shown. problem is, older browsers did not share info js & developers left using hacks like,
using of flash. flash plugin keep track of amount of data uploaded & hence tell javascript.
a method of approximating time works in cases.
the choice remains ping server continuously know how transfer took place.
Comments
Post a Comment