一个js文件导入js的函数

$(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);


	};

})

  

posted @ 2018-05-13 14:18  充实地生活着  阅读(1622)  评论(0编辑  收藏  举报