[問題] IE9 .ajax() xml big5編碼 中文值問題
想去拿xml檔裡的東西 (編碼為big5)
$.ajax({
url:'testurl',
type: 'POST',
dataType: 'xml',
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
success: function(d){
// do somthing
}
});
程式碼大概是這樣
在IE10沒有問題,但是在IE9以下都會拿到亂碼
(success後拿到的d裡面只要有中文就是亂碼)
想請問在不能變動xml檔案編碼的情況下,有什麼解決方法嗎?
或者應該試試寫原始的XmlHttpRequest?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.130.37
→
09/10 01:58, , 1F
09/10 01:58, 1F
→
09/10 01:58, , 2F
09/10 01:58, 2F
→
09/10 01:59, , 3F
09/10 01:59, 3F
→
09/10 01:59, , 4F
09/10 01:59, 4F
→
09/10 02:01, , 5F
09/10 02:01, 5F
→
09/10 02:09, , 6F
09/10 02:09, 6F
→
09/10 02:12, , 7F
09/10 02:12, 7F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章