用户
 找回密码
 入住 CI 中国社区
搜索
查看: 4826|回复: 2
收起左侧

[HELP] 写在head标签里的内容跑到body标签里去了!!

[复制链接]
发表于 2011-10-19 10:17:33 | 显示全部楼层 |阅读模式
本帖最后由 Cheney 于 2011-10-19 10:23 编辑

head.php------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>FrundVC</title>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>application/css/init.source.css" />
    <script src="<?php echo base_url()?>application/js/base/sea.js"></script>

</head>
<body>
<div id="head"></div>
<div id="main">

index.php-------------------- -------------------- --------------------
<?php $this->load->view('head.php'); ?>
。。。
</div>
<div id="foot"></div>
</body></html>

结果index.php输出的HTML居然是:
<html>
<head>
</head>
<body>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>FrundVC</title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8021/fundvc/application/css/init.source.css">
    <script src="http://localhost:8021/fundvc/application/js/base/sea.js"></script>

<div id="head"></div>
<div id="main">
。。。
</div>
<div id="foot"></div>
</body></html>
# 把head.php去掉,内容直接放在index.php里就不会出现这个问题了~~~





发表于 2011-10-19 17:16:37 | 显示全部楼层
出现怪异问题,一般都是低级错误引起的。
 楼主| 发表于 2011-10-20 20:37:38 | 显示全部楼层
问题已解决,事实证明不是低级错误,ls不要妄自揣测,讲话要踏实。

是编码问题,UTF8带BOM后就这样了,而且在firefox下不会出错

本版积分规则