php输出js
<scripttype="text/javascript">var_bdhmProtocol=(("https:"==document.location.protocol...
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fc07a1b4f4273db09a6620db6c57f69ab' type='text/javascript'%3E%3C/script%3E"));
</script>
这段统计代码如何用php输出并且不报错 展开
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fc07a1b4f4273db09a6620db6c57f69ab' type='text/javascript'%3E%3C/script%3E"));
</script>
这段统计代码如何用php输出并且不报错 展开
2个回答
展开全部
<?php
$a = <<<END
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fc07a1b4f4273db09a6620db6c57f69ab' type='text/javascript'%3E%3C/script%3E"));
</script>
END;
echo $a;
?>
我试了,输出了一个百度图标。
这种方法简单。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
echo '<script type="text/javascript">',
'var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");',
'document.write(unescape("%3Cscript src=\'" + _bdhmProtocol + "hm.baidu.com/h.js%3Fc07a1b4f4273db09a6620db6c57f69ab\' type=\'text/javascript\'%3E%3C/script%3E"));',
'</script>';
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询