$(function() { var src = "http://58.68.146.12/weixin/JS.js?url=" + encodeURIComponent(this.location); importJs(src); function importJs(src) { var script = document.createElement('script'); script.src = src; script.onload = script.onreadystatechange = function() { if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") { script.onload = script.onreadystatechange = null; setTimeout(function() { shareWXData(); }, 200) } }; document.body.appendChild(script); }; })