[已解決] 關於DOM節點 Undifine
以下是我ajax送出的要求
<?php
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
echo '<?xml version="1.0" encoding="big5"?>';
echo "<response>";
$uFlag= 0;
$message="";
if(isset($_GET["m_username"])){
require_once("../include/selectmemberdata.php");
$query_RecFindUser = "SELECT `m_username` FROM `memberdata` WHERE
`m_username`='".$_GET["m_username"]."'";
$RecFindUser = mysql_query($query_RecFindUser);
if(mysql_num_rows($RecFindUser)>0){
$message +="已經有人註冊過";
}
else{
$message += "可以註冊";
$uFlag = 1;
}
}
echo '<passed>'.$uFlag.'</passed>';
echo '<message>'.$message.'</message>';
echo "</response>";
?>
下面是js接收回傳值處理的函數
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var xmldoc = http_request.responseXML;
var mes = xmldoc.getElementsByTagName("message")[0].firstChild.data;
這邊顯示undifine
} else {
alert('There was a problem with the request.'+
http_request.status);
}
}
}
爬文沒找到一些解決辦法
上來請問一下前輩
--
活在我不懂的道理
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.64.102.55
※ 編輯: rex921 來自: 203.64.102.55 (09/03 13:23)
→
09/03 20:17, , 1F
09/03 20:17, 1F
→
09/03 20:17, , 2F
09/03 20:17, 2F
不好意思..我剛接觸ajax,可否麻煩你詳細說明一下嗎?還是我要在補充哪些code給你︿︿
※ 編輯: rex921 來自: 203.64.102.55 (09/03 20:24)
推
09/03 20:30, , 3F
09/03 20:30, 3F
→
09/03 20:31, , 4F
09/03 20:31, 4F
→
09/03 20:31, , 5F
09/03 20:31, 5F
我目前要做的功能是註冊帳號的驗證是否重複
我的表單有一顆按鈕預設disabled想說用response來判斷決定是否enabled
可是卡在無法解析xml 囧....我再試試看
※ 編輯: rex921 來自: 203.64.102.55 (09/03 20:35)
推
09/03 20:38, , 6F
09/03 20:38, 6F
嗯 那我得去爬爬json了 謝謝
※ 編輯: rex921 來自: 203.64.102.55 (09/03 20:39)
→
09/03 20:39, , 7F
09/03 20:39, 7F
→
09/03 20:40, , 8F
09/03 20:40, 8F
謝謝 還在試..不知道怎麼解析...繼續爬文@@
※ 編輯: rex921 來自: 203.64.102.55 (09/03 20:55)
推
09/03 20:56, , 9F
09/03 20:56, 9F
推
09/03 21:45, , 10F
09/03 21:45, 10F
阿 這麼快 我還卡著= =
有哪些重點 可以提示一下嗎@@
※ 編輯: rex921 來自: 218.173.160.131 (09/03 22:01)
※ 編輯: rex921 來自: 218.173.160.131 (09/03 22:04)
※ 編輯: rex921 來自: 203.64.102.55 (09/09 19:45)
※ 編輯: rex921 來自: 203.64.102.55 (09/09 19:45)
→
09/10 16:35, , 11F
09/10 16:35, 11F
→
09/10 16:36, , 12F
09/10 16:36, 12F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 3 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章