php ajax 實現(xiàn)分頁技術(shù)-php編程教程

php ajax 實現(xiàn)分頁技術(shù)-php編程教程

ID:13572130

大?。?9.50 KB

頁數(shù):9頁

時間:2018-07-23

php ajax 實現(xiàn)分頁技術(shù)-php編程教程_第1頁
php ajax 實現(xiàn)分頁技術(shù)-php編程教程_第2頁
php ajax 實現(xiàn)分頁技術(shù)-php編程教程_第3頁
php ajax 實現(xiàn)分頁技術(shù)-php編程教程_第4頁
php ajax 實現(xiàn)分頁技術(shù)-php編程教程_第5頁
資源描述:

《php ajax 實現(xiàn)分頁技術(shù)-php編程教程》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫

1、基于php和ajax的分頁技術(shù)代碼,下面有兩個php文件,一個是sn_inq.php,另一個是sn_show.php,前一個php文件調(diào)用后一個php文件,實現(xiàn)ajax分頁,運行sn_inq即可實現(xiàn)效果,不過得修改數(shù)據(jù)庫哦。具體代碼如下:紅色標注的地方要特別注意修改哦!我的數(shù)據(jù)庫名是inv,表名是sn,字段有:sn_id,sn_plant,sn_sales,sn_act,sn_type,sn_sts.....1.sn_inq.php//getFormValue用于獲取表單中所有輸入控件的值,并將輸入值組成一個字符串傳到服務器。

2、ype="text/javascript">functiongetFormValue(form){varstr='';varft,fv;for(vari=0;i

3、(fv.value)+'&';}break;case'checkbox':if(fv.checked){str+=fv.name+'='+escape(fv.value)+'&';}break;case'text':str+=fv.name+'='+escape(fv.value)+'&';break;case'password':str+=fv.name+'='+escape(fv.value)+'&';break;case'hidden':str+=fv.name+'='+escape(fv.value)+'&';break;case't

4、extarea':str+=fv.name+'='+escape(fv.value)+'&';break;default:break;}}returnstr.split(/s/).join('')}//showcomment(page)用于顯示分頁數(shù)據(jù),被查詢按鈕onclick事件調(diào)用,url為后臺處理數(shù)據(jù)并輸出XML格式數(shù)據(jù)的文件url。functionshowcomment(page){varx=newAjax('statusid','XML');url='sn_show.php?page='+page+'&'+getFormValue

5、(document.form1);x.get(url,function(s){if(s.lastChild){getbyid("show").innerHTML="Loading……";getbyid("show").innerHTML=s.lastChild.firstChild.nodeValue;removeLoading(document.getElementById("show"));}else{document.form1.submit();}});}//displayLoading用于顯示Loading,提示用戶等待functi

6、ondisplayLoading(element){varimage=document.createElement("img");image.setAttribute("src","progressbar.gif");image.setAttribute("title","loading...");vartext=document.createTextNode("loading……");element.appendChild(image);element.appendChild(text);}//removeLoading用于去掉Loadin

7、gfunctionremoveLoading(element){varimage=element.getElementsByTagName("img");for(vari=0;i

8、(navigator.userAgent.toLowerCase().indexOf('opera')>-1){clientHeight=document.body

當前文檔最多預覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當前文檔最多預覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學公式或PPT動畫的文件,查看預覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負責整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時聯(lián)系客服。
3. 下載前請仔細閱讀文檔內(nèi)容,確認文檔內(nèi)容符合您的需求后進行下載,若出現(xiàn)內(nèi)容與標題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。