Jump to content
IPS Community Suite 简体中文
Sign in to follow this  
cowboy

关于百度推送问题

Recommended Posts

image.thumb.png.2c36e810db474973ef1a01ca7fa85d1e.png

能否出个详细点的教程,这个主动推送我是没看懂。。

时时推送

自动推送代码如何安装使用?

站长需要在每个页面的HTML代码中包含以下自动推送JS代码:

<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https'){
   bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>

如果站长使用PHP语言开发的网站,可以按以下步骤操作:
1、创建名为“baidu_js_push.php”的文件,文件内容是上述自动推送JS代码;
2、在每个PHP模板页文件中的 <body> 标记后面添加一行代码:
<?php include_once("baidu_js_push.php") ?>

应该安插到哪些页面?

Share this post


Link to post

唉,我对百度不怎么感兴趣,有空了再看吧。

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×