一个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);


	};

})

  

猜你喜欢

转载自www.cnblogs.com/cblx/p/9032037.html