current position:Home>JQuery get page address parameters

JQuery get page address parameters

2022-05-15 02:05:49thankseveryday

//  Access to the page  url  Parameters 
$.getUrlParam = 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;
}
//  Use 
$.getUrlParam('id');

copyright notice
author[thankseveryday],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/132/202205120527259100.html

Random recommended