FED

©FrontEndDev.org
2015 - 2024
web@2.22.0 api@2.20.0

微信三方登录js改写

!function(a,b){
		function d(a){
			var e,
						c = b.createElement("iframe"),
						d = "https://open.weixin.qq.com/connect/qrconnect?appid=" + a.appid + "&scope=" + a.scope + "&redirect_uri=" + a.redirect_uri + "&state=" + a.state + "&login_type=jssdk";
						d += a.style ? "&style=" + a.style : "",
						d += a.href ? "&href=" + a.href : "",
						c.src = d,
						c.frameBorder = "0",
						c.allowTransparency = "true",
						c.scrolling = "no",
						c.width = "300px",
						c.height = "400px",
						e = b.getElementById(a.id),
						e.innerHTML = "",
						e.appendChild(c)
		}
		a.WxLogin=d
	}(window,document);

(以上代码出处 http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js ) 微信三方登录的一个js文件,我尝试改写成coolie的模块总是提示有错,请问这种具体要如何改写呢? 正常情况下是这样实例化的,

 var obj = new WxLogin({
                        id:"wxLoginQRCode",
                        appid: load.thirdLoginRequestJsonData.WeChat.WeiXinAppId,
                        scope: load.thirdLoginRequestJsonData.WeChat.WeiXinScope,
                        redirect_uri: load.thirdLoginRequestJsonData.WeChat.WeiXinRedirectUrl,
                        state: load.thirdLoginRequestJsonData.WeChat.WeiXinState,
                        style: load.thirdLoginRequestJsonData.WeChat.WeiXinStyle,
                        href: load.thirdLoginRequestJsonData.WeChat.WeiXinHref
                    });