【发布时间】:2011-10-28 01:02:08
【问题描述】:
我正在使用以下代码加载内容:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery('.content-div').load("all-events.html");
});
</script>
但是,加载的内容没有我想要的 UTF-8 特殊字符。 有人在某处提到将其放在我的代码顶部:
$html = header('Content-Type: text/html; charset=utf-8');
但是我只得到了这个错误: '标题未定义'。
【问题讨论】:
-
你能给我们举个例子吗?没有看到真实数据很难猜测。
-
您调用
header()的第二个代码块是PHP?你用什么来服务你的页面。您尝试实现的代码 sn-p 表明对客户端load()的服务器端 HTTP 响应需要包含内容类型标头。 -
好的,如果你在谈论 PHP,我使用了以下代码:
<?php header ('Content-type: text/html; charset=utf-8'); ?>这给了我这个错误Warning: Cannot modify header information - headers already sent by (output started at
标签: jquery