我有兩個.asp腳本 - 第一個將sys.tables和sys.views的內容複製到SQL中的另一個表。第二屆腳本計算(從newtable的/(COUNT(從SYS.TABLES從sys.views計數())+ COUNT(*)))完成百分比在等待Ajax響應時調用循環的javascript函數
* 100
我有一個功能調用第一個腳本。
function importTablesAndViews()
{
xmlhttpImportTablesAndViews=GetXmlHttpObject();
if (xmlhttpImportTablesAndViews==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
url="importtablesandviews.asp";
url=url+"?sid="+Math.random();
xmlhttpImportTablesAndViews.onreadystatechange=function(){if (xmlhttpImportTablesAndViews.readyState==4){
var aspResponse = xmlhttpImportTablesAndViews.responseText;
alert(aspResponse); }}
xmlhttpImportTablesAndViews.open("GET",url,true);
xmlhttpImportTablesAndViews.send(null);
}
我有另一個函數來調用進度腳本
function refreshImportProgress()
{
//alert('Refresh...');
xmlhttpRefreshImportProgress=GetXmlHttpObject();
if (xmlhttpRefreshImportProgress==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
url="importtablesandviewsprogress.asp";
url=url+"?sid="+Math.random();
xmlhttpRefreshImportProgress.onreadystatechange=function(){if (xmlhttpRefreshImportProgress.readyState==4){
var aspResponse = xmlhttpRefreshImportProgress.responseText; document.getElementById('progressDiv').innerHTML = aspResponse; }}
xmlhttpRefreshImportProgress.open("GET",url,true);
xmlhttpRefreshImportProgress.send(null);
}
我希望能夠做的是呼籲3秒的間隔refreshImportProgress()函數從importTablesAndViews內什麼()函數。
這可能嗎?我曾嘗試使用谷歌同步阿賈克斯請求,但迄今沒有多少運氣。