weixin = document.createElement("script"); weixin.setAttribute("src", "http://res.wx.qq.com/open/js/jweixin-1.0.0.js"); document.getElementsByTagName("head")[0].appendChild(weixin); weixin.onload = function(){ wx.config({ debug: false, appId: 'wxd0aa86719fd88894', timestamp: 1476857590, nonceStr: 'c449MhV7IXf4aSeF', signature: '8e9d87ff4f72f2942191d7416cc05e8a3859ae35', jsApiList: [ "onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo" ] }); wx.ready(function () { wxinit(); }); }