获取浏览器参数优化

This commit is contained in:
gongfuxiang 2022-05-10 14:15:40 +08:00
parent b072c332cf
commit 77f6d11125

View File

@ -2038,13 +2038,19 @@ function HtmlToString(html_str)
*/
function GetQueryValue(field = null)
{
// 参数值
var query = window.location.search || null;
if(query == null)
// 路径参数值
var path = window.location.pathname || null;
var query = (path == null || path == '/') ? '' : path
// 问号后面的参数值
var search = window.location.search || null;
if(search != null)
{
query = window.location.pathname || null;
} else {
query = query.substring(1);
if(query != '')
{
query += '&';
}
query += search.substring(1);
}
// 首两个是否为s=字符,存在则去除