码迷,mamicode.com
首页 > Web开发 > 详细

获取url参数值

时间:2019-09-02 13:53:55      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:style   color   ace   class   new   参数   cat   ref   url参数   

获取url参数值,记录一下方便以后用到

// 获取url参数
const getUrlKey = name => {
    return decodeURIComponent((new RegExp(‘[?|&]‘ + name + ‘=‘ + ‘([^&;]+?)(&|#|;|$)‘).exec(location.href) || [, ""])[1].replace(/\+/g, ‘%20‘)) || null
};

 

获取url参数值

标签:style   color   ace   class   new   参数   cat   ref   url参数   

原文地址:https://www.cnblogs.com/double405/p/11445898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!