[問題]框架頁執行ajax後發生問題

看板Ajax作者 (aileen)時間16年前 (2008/12/31 01:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
小妹在寫ajax時發生了一些問題 畫面只是一般的框架頁 左邊放連結,右邊就放連結的網頁 一開始都沒有問題 但我的網頁只要執行過ajax後 左邊點選連結時不會在右邊顯示 而是會開新網頁 ajax的部分程式如下 function getstudata() { if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) { name = encodeURIComponent(document.getElementById("a_stu_no").value); xmlHttp.open("GET", "studata.php?name=" + name, true); xmlHttp.onreadystatechange = handleServerResponse; xmlHttp.send(null); } } function handleServerResponse() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { xmlResponse = xmlHttp.responseXML; xmlDocumentElement = xmlResponse.documentElement; Message = xmlDocumentElement.firstChild.data; } else { alert("There was a problem accessing the server: " + xmlHttp.statusText); } } } 請問一下是不是我有地方寫錯呢? 謝謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.171.118.204
文章代碼(AID): #19MbKCx3 (Ajax)
文章代碼(AID): #19MbKCx3 (Ajax)