根据地址栏获取对应值

function GetURLlist(i) {
    return decodeURIComponent((new RegExp('[?|&]' + i + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/+/g, '%20')) || null;
};

  

GetURLlist('token')

  

原文地址:https://www.cnblogs.com/yuanyanbk/p/9181968.html