(function () { var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; console.log(curProtocol); if (curProtocol === 'https') { bp.src = 'https://v1.qiaodu.net/push.js'; } else { bp.src = 'http://v1.qiaodu.net/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();
Done!