1.首先要进行js接口安全域名的设置和配置
分享页面引用微信js
<script src="
http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
//公众号appid,时间戳,随机字符串,后台返回签名信息,分享标题,分享链接,分享内容48字以内,分享图片
Myth.common.wxShare.WxShare('<%=appId%>', '<%=timestamp%>', '<%=nonceStr%>', '<%=signature%>', '<%=newTitle%>', '<%=Link%>', '<%=Desc%>', '<%=ImgUrl%>');
///封装模块JS
(function (window, $) {
var Myth = window.Myth = function () { };
Myth.fn = Myth.prototype;
var common = Myth.common = Myth.fn.common = {}
//微信分享
var wxShare=common.wxShare= {
WxShare: function (appId, timestamp, nonceStr, signature, title, link, desc, imgUrl) {
//通过config接口注入权限验证配置
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
&nb