with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
修改成
with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
ok了,现在我们就可以正常使用百度分享了。
这里再分享一个技能。如果你使用的是欲思WordPress主题,那么在IE浏览器下面会导致百度分享样子乱了,不过我们可以通过下面方式修改。将footer.php
文件中的下面代码
with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
移到js/jquery.js
文件中的share:[{bdCustomStyle:"/wp-content/themes/yusi2.0/share.css"}],};
代码后面,如下:
share:[{bdCustomStyle:"/wp-content/themes/yusi2.0/share.css"}],};with(document)0[(getElementsByTagName("head")[0]||body).appendChild(createElement("script")).src="/static/api/js/share.js?v=89860593.js?cdnversion="+~(-new Date()/36e5)];
然后网站在IE浏览器下百度分享就不会乱了。