//轉換編碼 防止ajax亂碼
response.setHeader("content-type","text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
這三句話 一定要加到 方法開始的地方
例如:
前台頁面:
親測有用 原創--wangchunyang
//轉換編碼 防止ajax亂碼
response.setHeader("content-type","text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
這三句話 一定要加到 方法開始的地方
例如:
前台頁面:
親測有用 原創--wangchunyang
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。