[問題] 簡單的ajax在ie9會錯誤(已解)
我要做的功能只是很單純的檢查帳號存不存在的狀況
js 如下這樣寫
$.ajax({
type:"GET",
url:"ask_account.php",
data:{account:mail},
dataType:"html",
async: false,
success:function(ret){
if(ret=="1") {
$("#nt_msg").html("帳號已存在");
} else {
$("#nt_msg").html("帳號可使用");
}
}
});
而 php 檔的部分
$get = $_GET;
$mail = $get["account"];
if(isIDExist($mail)) { // isIDExist 檢查存在而已
echo "1";
} else {
echo "0";
}
我在 Chrome , Firefox , Opera 都可以正常跑出存在的結果
但在 IE9 的狀況則是 ret 不管怎麼用都是 undefined
是過 $.get 的方式也一樣
對於這種狀況該如何修正~"~...
* 我嘗試過把檔案傳到 SERVER 上的結果也是一樣
--
[There's no undo in your life]
●~ ●~ ●~ ●~ ●~ ●~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.186.193
推
06/17 23:44, , 1F
06/17 23:44, 1F
→
06/17 23:54, , 2F
06/17 23:54, 2F
推
06/17 23:56, , 3F
06/17 23:56, 3F
→
06/17 23:57, , 4F
06/17 23:57, 4F
推
06/17 23:57, , 5F
06/17 23:57, 5F
推
06/17 23:58, , 6F
06/17 23:58, 6F
→
06/17 23:58, , 7F
06/17 23:58, 7F
推
06/18 00:00, , 8F
06/18 00:00, 8F
→
06/18 00:07, , 9F
06/18 00:07, 9F
推
06/18 01:20, , 10F
06/18 01:20, 10F
→
06/18 01:21, , 11F
06/18 01:21, 11F
推
06/18 04:25, , 12F
06/18 04:25, 12F
→
06/18 04:26, , 13F
06/18 04:26, 13F
→
06/18 09:00, , 14F
06/18 09:00, 14F
→
06/18 09:01, , 15F
06/18 09:01, 15F
→
06/18 09:01, , 16F
06/18 09:01, 16F
推
06/18 10:05, , 17F
06/18 10:05, 17F
→
06/18 10:17, , 18F
06/18 10:17, 18F
→
06/18 10:17, , 19F
06/18 10:17, 19F
→
06/18 10:18, , 20F
06/18 10:18, 20F
把我的 ask_account 丟出來測試好了 ..
http://www.sunlin.org.tw/yjrivers/ask_account.php?account=xxxxx
基本上就是這頁了。
(別偷看其他頁就好QQ.. 我的 desinger 是用 dw 套畫面,相容性很低,沒時間改)
推
06/18 12:55, , 21F
06/18 12:55, 21F
→
06/18 14:04, , 22F
06/18 14:04, 22F
→
06/18 14:04, , 23F
06/18 14:04, 23F
→
06/18 14:05, , 24F
06/18 14:05, 24F
推
06/18 14:54, , 25F
06/18 14:54, 25F
→
06/18 14:54, , 26F
06/18 14:54, 26F
→
06/18 14:55, , 27F
06/18 14:55, 27F
推
06/18 15:04, , 28F
06/18 15:04, 28F
→
06/18 15:20, , 29F
06/18 15:20, 29F
→
06/18 15:20, , 30F
06/18 15:20, 30F
推
06/18 15:29, , 31F
06/18 15:29, 31F
→
06/18 15:29, , 32F
06/18 15:29, 32F
→
06/18 15:29, , 33F
06/18 15:29, 33F
→
06/18 15:29, , 34F
06/18 15:29, 34F
http://www.sunlin.org.tw/yjrivers/newaccount.php
給大家測試一下好了~"~
帳號用 newculturetalk@gmail.com
CHROME 底下會顯示 帳號已存在
IE 底下就會顯示 帳號可使用
實際上這個帳號是存在的~"~...
---
我在家了,上面測試依舊失敗
另外我直接使用 $.ajax 讀自己的 index ,
$.ajax({ url:"index.php", type:"get", success:function(rett) { alert(rett);
}});
一樣是回 undefined...= ="
※ 編輯: kerash 來自: 114.32.186.193 (06/18 20:09)
→
06/18 20:18, , 35F
06/18 20:18, 35F
推
06/18 22:57, , 36F
06/18 22:57, 36F
→
06/18 22:58, , 37F
06/18 22:58, 37F
→
06/18 22:58, , 38F
06/18 22:58, 38F
→
06/18 23:04, , 39F
06/18 23:04, 39F
找到解答了 ...
我的 CONFIG 裡面有這行
header("Content-type: text/html; charset=utf8");
UTF8->UTF-8....
= ="
所以錯誤不是在語法,是PHP打錯
※ 編輯: kerash 來自: 114.32.186.193 (06/18 23:10)
推
06/18 23:15, , 40F
06/18 23:15, 40F
→
06/18 23:15, , 41F
06/18 23:15, 41F
→
06/18 23:16, , 42F
06/18 23:16, 42F
→
06/18 23:16, , 43F
06/18 23:16, 43F
→
06/18 23:16, , 44F
06/18 23:16, 44F
→
06/19 00:34, , 45F
06/19 00:34, 45F
→
06/19 09:10, , 46F
06/19 09:10, 46F
→
06/19 09:11, , 47F
06/19 09:11, 47F
→
06/19 09:11, , 48F
06/19 09:11, 48F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
14
48
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章