+ -
当前位置:首页 → 问答吧 → php jquery smarty 乱码问题

php jquery smarty 乱码问题

时间:2011-10-04

来源:互联网

第一种情况不乱码
a.html
  1. $(document).ready(function(){
  2.         $("#button").click(function(){
  3.         $("#word").load('b.php');

  4.         });
复制代码

b.php
  1. header('Content-type: text/html;charset=GB2312');
  2. 这里显示中文
复制代码


此时中文不显示乱码

第二种情况乱码,不知道为什么
a.html
  1. $(document).ready(function(){
  2.         $("#button").click(function(){
  3.         $("#word").load('b.php');

  4.         });
复制代码

b.php
  1. header('Content-type: text/html;charset=GBK');
  2. $smarty->display(c.html)
复制代码


3.html
  1. 这里显示中文
复制代码


所有文件编码都为GBK
此时中文乱码,
为什么呢,求大师解决!

作者: 风的影子   发布时间: 2011-10-04

先指定下编码

作者: tangxuewu   发布时间: 2011-10-04

相关阅读 更多