我在看百度分享生成的代码时,有一段看不懂的代码
with(document)
0[(document.getElementsByTagName('head')[0] || document.body).appendChild(document.createElement('script')).src =
'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
唯一不能理解的就是 0[xxx]的部分。[]中创建script标签、加载标签的代码,为什么要写在0[]?。 自己有去尝试,不使用0[],代码功能还是完善的。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。