日期:2014-05-17  浏览次数:20965 次

插入统计代码错误
想要给数据库中插入这样一段:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12298331-1");
pageTracker._trackPageview();
} catch(err) {}</script>

其他加了这个就会报错document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
去掉就不报错了,
怎样才能正常插入document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));


------解决方案--------------------
可以参考这里

http://topic.csdn.net/t/20051104/13/4371561.html