Ajax 的 responseText 中文亂碼問題
剛剛在實驗 element.innerHTML = AJAX.responseText 時候碰到了中文亂碼問題,稍微找了一下,以下是最簡單的解法。 假設 AJAX.open('POST', 'cgi.php', true), 然後 cgi.php 要輸出中文的內容,那記得在輸出前先丟個 header: header('Content-Type:text/html;charset=big5'); 問題解決。 對付 responseXML 時候把 text/html 改成 [...]
Categories
- Bioinformatics (1)
- 當我們同宅一起 (12)
- Family (16)
- Footprints + Diary (150)
- 2005 Summer Road Trip (9)
- 2005 X'Mas Seattle (8)
- 2006 Summer (14)
- 2006 Winter Caribbean (1)
- College (Mesa) (2)
- College (UCSD) (23)
- High School (US) (2)
- Recreation (8)
- Fun+Humor (32)
- Interests (10)
- IT (98)
- recipe (1)
- Reflection (37)
- Server Diary (37)
- ffmud.net (1)
- lmj.tw (3)
- slicehost (1)
- tarotoast.com (11)
- twfamily.org (2)
- tworz.org (1)
- software (1)
