js 伪静态 获取URL
现在出现一个奇怪的问题,请大家帮帮忙!配置了伪静态
<RewriterRule>
<LookFor>~/SevenNews/(.[0-9]*)\.html</LookFor>
<SendTo>~/SevenNews.aspx?type=$1</SendTo>
</RewriterRule>
用JS却获取不到URL的type参数,但是不用伪静态转发直接用SevenNews.aspx?type=1就可以获取到URL参数。
JS用的是
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for(var i = 0; i < strs.length; i ++) {
theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
</script>
请教高手!谢谢!非常感谢!