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

[已解决] 查看日志文件,所有内容都运行了两遍?

[复制链接]
发表于 2010-7-16 10:30:28 | 显示全部楼层 |阅读模式
本帖最后由 ici 于 2010-7-16 10:31 编辑
PHP复制代码
 
DEBUG - 2010-07-16 10:22:31 --> Config Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Hooks Class Initialized
DEBUG - 2010-07-16 10:22:31 --> URI Class Initialized
DEBUG - 2010-07-16 10:22:31 --> No URI present. Default controller set.
DEBUG - 2010-07-16 10:22:31 --> Router Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Output Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Input Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Global POST and COOKIE data sanitized
DEBUG - 2010-07-16 10:22:31 --> Language Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Loader Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Controller Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Helper loaded: url_helper
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Database Driver Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/head.php
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/center.php
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/footer.php
DEBUG - 2010-07-16 10:22:31 --> Final output sent to browser
DEBUG - 2010-07-16 10:22:31 --> Total execution time: 0.1321
/*====分割线=============================*/
DEBUG - 2010-07-16 10:22:31 --> Config Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Hooks Class Initialized
DEBUG - 2010-07-16 10:22:31 --> URI Class Initialized
DEBUG - 2010-07-16 10:22:31 --> No URI present. Default controller set.
DEBUG - 2010-07-16 10:22:31 --> Router Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Output Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Input Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Global POST and COOKIE data sanitized
DEBUG - 2010-07-16 10:22:31 --> Language Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Loader Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Controller Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Helper loaded: url_helper
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Database Driver Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> Model Class Initialized
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/head.php
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/center.php
DEBUG - 2010-07-16 10:22:31 --> File loaded: application/views/footer.php
DEBUG - 2010-07-16 10:22:31 --> Final output sent to browser
DEBUG - 2010-07-16 10:22:31 --> Total execution time: 0.1218
 
复制代码

分割线上下初始化,加载的内容都一样,应该是运行了两遍,请问这是怎么回事?
谢谢
发表于 2010-7-16 11:20:18 | 显示全部楼层
你多刷新了一下吧?或者这个页面有其他的请求???
 楼主| 发表于 2010-7-16 11:56:07 | 显示全部楼层
你多刷新了一下吧?或者这个页面有其他的请求???
ywqbestever 发表于 2010-7-16 11:20

firebug一看,真是请求了两次!
奇了怪了,就是在地址栏输入地址,然后按回车啊,怎么回事两次呢?
发表于 2010-7-16 11:56:48 | 显示全部楼层
有 ajax 请求?
 楼主| 发表于 2010-7-16 12:03:25 | 显示全部楼层
有 ajax 请求?
Hex 发表于 2010-7-16 11:56

没有ajax
就是单纯的从数据库取些数据,然后给视图
发表于 2010-7-16 12:20:32 | 显示全部楼层
用exit逐行查,在哪个动作前后,看日志文件突然多了个请求
有ide用她设debug点也行
 楼主| 发表于 2010-7-16 13:49:31 | 显示全部楼层
多谢各位!
找到原因了,原来是这句造成的:
<script language="JavaScript" type="text/javascript" src="" ></script>
这句是编辑器默认模板文件自带的,可能是这个src="" 造成了又请求了一次。
新建了一个html文件,firebug里的确是又请求了一次...
---------------------------------------------------------------------
继续ci日志文件:
ie6下对这个src="" 直接无视,日志只显示了一遍。
ie7,8下(清除缓存,第一次打开页面)日志出现了这句:
ERROR - 2010-07-16 13:24:23 --> 404 Page Not Found --> favicon.ico
favicon.ico根本都没有在html里面指定过,应该还是js文件的src=""引起的吧?在原页面上刷新了几次之后,日志显示ERROR没有了,也只显示了一遍。

多谢各位啊 :)
发表于 2010-7-16 13:54:21 | 显示全部楼层
favicon.ico 是浏览器自动引用的,也就是所谓的“站点图标”。不是 src="" 引起的。
src="" 从字面理解,就是取当前路径下的文件,也就是根目录,所以会造成一次请求,但是不同浏览器可能解释不同,呵呵
 楼主| 发表于 2010-7-16 14:06:07 | 显示全部楼层
favicon.ico 是浏览器自动引用的,也就是所谓的“站点图标”。不是 src="" 引起的。
src="" 从字面理解,就 ...
Hex 发表于 2010-7-16 13:54

嗯,刚才注释掉js文件那行,然后用ie8打开,日志还是出现了ERROR,应该是ie自动引用那个favicon图标了,ff下没有问题。

本版积分规则