詳解php+ajax開發(fā)的注意事項(xiàng)(3)_PHP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:解析用PHP操作MySql數(shù)據(jù)庫?php /* *mysql數(shù)據(jù)庫分頁類 *@packagepagelist *@authoryytcpt(無影) *@version2008-03-27 *@copyrigthhttp://www.d5s.cn/ */ /* *分頁樣式 .page{float:left;font:11pxArial,Helvetica,sans-serif;padding:6px0;margin:0px10%;margin-top:10px;} .pagea,.pa
function sendRequest(strurl) {
httpRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!httpRequest) {
window.alert("通訊失敗");
return false;
}
httpRequest.onreadystatechange = processRequest;
httpRequest.open("GET", strurl, true);
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
httpRequest.send(null);
}>}
function asychronouscheck(strparam){
if(strparam.value.length == 0){
document.getElementById("state3").innerHTML="新帳號(hào)不能為空";
}
var strurl="checknewaccount.php?name="+encodeURIComponent(strparam.value);
sendRequest(strurl);
<BR pre="">
function asychronouscheck(strparam){
if(strparam.value.length == 0){
document.getElementById("state3").innerHTML="新帳號(hào)不能為空";
}
var strurl="checknewaccount.php?name="+encodeURIComponent(strparam.value);
sendRequest(strurl);
表單部分
<dl>
<dt>新帳號(hào)</dt>
<dd><label id="state3"></label></dd>
<dd><input type="text" name="nusername" id="nusername" size="26" maxlength="14" onblur="asychronouscheck(this)" /></dd>
</dl>
<dl>
<dt>新帳號(hào)</dt>
<dd><label id="state3"></label></dd>
<dd><input type="text" name="nusername" id="nusername" size="26" maxlength="14" onblur="asychronouscheck(this)" /></dd>
</dl>
分享:解析用PHP操作MySql數(shù)據(jù)庫(DB類)?php /* *mysql數(shù)據(jù)庫DB類 *@packagedb *@authoryytcpt(無影) *@version2008-03-27 *@copyrigthhttp://www.d5s.cn/ */ classdb{ varconnection_id=; varpconnect=0; varshutdown_queries=array(); varqueries=array(); varquery_id=; varquery_count=0; v
相關(guān)PHP教程:
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時(shí)間
- PHP中獎(jiǎng)概率的抽獎(jiǎng)算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對(duì)圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運(yùn)算符優(yōu)先級(jí)介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實(shí)現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
- 相關(guān)鏈接:
- 教程說明:
PHP教程-詳解php+ajax開發(fā)的注意事項(xiàng)(3)
。