百度分享完全js代码的改进
var body = document.getElementsByTagName; var script1 = document.createElement('script'); script1.id = "bdshare_js"; script1.setAttribute('data', "type=slide&img=3&mini=1&pos=right&uid=666988"); body.appendChild(script1); var script2 = document.createElement('script'); script2.id = "bdshell_js"; script2.src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000); body.appendChild(script2);使用jq的同学们注意了,jq在append一个script标签时总是问题很多的样子,使用jsonp(自己重写)使用了$.fn.appned(script)结果出现发送了两次
百度分享的jq append不知为何没生效
页:
[1]