jquery获取url的方式
程序员文章站
2022-06-24 20:54:47
(function ($) { $.getUrlParam = function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).mat ......
(function ($) { $.geturlparam = function (name) { var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return decodeuri(r[2]); return null; } })($);