At first you need to call the script using an Ajax request. All jQuery ajax methods offer function callbacks that are called when the call is completed. You can show the progress bar when you make the request and hide it, when it is finished:
$("#MyProgressBar").show();
$("#placeholder").load(myurl, function() {
$("#MyProgressBar").hide();
});
You could also use a plug-in like BlockUI.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…