qrCheck.js 709 Bytes
var qrCheck = {
    getQuery: function(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
        var r = window.location.search.substr(1).match(reg);

        if (r !== null) {
            return unescape(r[2]);
        }
        return null;
    },

    init: function() {
        var ifr,
            qr = this.getQuery('qr');

        if (qr) {
            ifr = document.createElement('iframe');
            ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
            ifr.style.display = 'none';
            document.body.appendChild(ifr);
            window.location.href = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
        }
    }
};

qrCheck.init();