1. 程式人生 > >jQuery獲取地址url中"?"符以及其後的字串

jQuery獲取地址url中"?"符以及其後的字串

jquery 及其 subst nbsp 問號 nor earch normal ear

var url = location.search;
if (url.indexOf("?") != -1)//url中存在問號,也就說有參數。
{
if (url.substr(1) == "abnormal") {
$.messager.alert(‘提示‘, "跳轉異常");
}

}

jQuery獲取地址url中"?"符以及其後的字串