JS获取URL“#”后的值
http://localhost:62683/youli/product.htm#0 alert(GetRequest()); //获取#号值 function GetRequest() { var str = location.href var num = str.indexOf("#"); str = str.substr(num + 1); return str; }
http://localhost:62683/youli/product.htm#0 alert(GetRequest()); //获取#号值 function GetRequest() { var str = location.href var num = str.indexOf("#"); str = str.substr(num + 1); return str; }