实现微信转发朋友圈和微信好友
<script src="http://res./open/js/jweixin-1.4.0.js"></script><script>//微信分享$.ajax({type:'GET',url:"/index.php/weixin/wx", //正式上线换上实际域名dataType:'JSON',success:function(res){// console.log(res);wx.config({debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。appId:res.appId, // 必填,公众号的唯一标识timestamp: res.timestamp, // 必填,生成签名的时间戳nonceStr:res.nonceStr, // 必填,生成签名的随机串signature:res.signature,// 必填,签名,见附录1jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2});wxready();}});function wxready() {wx.ready(function () {wx.onMenuShareTimeline({title: "分享标题",desc: '标题内容',link: "/mnls/",imgUrl: '/mnls/share.png',trigger: function (res) {},success: function (res) {},cancel: function (res) {},fail: function (res) {}});wx.onMenuShareAppMessage({title: "分享标题",desc: '标题内容',link: "/mnls/",imgUrl: '/mnls/share.png',trigger: function (res) {},success: function (res) {},cancel: function (res) {},fail: function (res) {}});})}</script>