Showing
2 changed files
with
27 additions
and
0 deletions
public/js/passport/login/qrCheck.js
0 → 100644
1 | +var qrCheck = { | ||
2 | + getQuery: function(name) { | ||
3 | + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); | ||
4 | + var r = window.location.search.substr(1).match(reg); | ||
5 | + | ||
6 | + if (r !== null) { | ||
7 | + return unescape(r[2]); | ||
8 | + } | ||
9 | + return null; | ||
10 | + }, | ||
11 | + | ||
12 | + init: function() { | ||
13 | + var ifr, | ||
14 | + qr = this.getQuery('qrcode'); | ||
15 | + | ||
16 | + if (qr) { | ||
17 | + ifr = document.createElement('iframe'); | ||
18 | + ifr.src = 'yohobuy:///http://m.yohobuy.com/signin.html?qr=' + qr; | ||
19 | + ifr.style.display = 'none'; | ||
20 | + document.body.appendChild(ifr); | ||
21 | + window.location.href = 'yohobuy:///http://m.yohobuy.com/signin.html?qr=' + qr; | ||
22 | + } | ||
23 | + } | ||
24 | +}; | ||
25 | + | ||
26 | +qrCheck.init(); |
-
Please register or login to post a comment