您好我正在使用ajax加載數據庫內容。我想顯示加載或圖像的總百分比。在ajax中顯示加載百分比的進度條,php
這是我的腳本
function name1(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","user.php?q="+str,true);
xmlhttp.send();
}
user.php的Q = RAM,它傳遞一個值。而取從數據庫 數據如何修改AJAX來顯示圖像加載
2012-02-21
Vineeth