这样一个页面
http://localhost/update.html?ver=936TWL5.21&yid=-1
看出他带有一些参数ver=XXXXX&yid=XXXXXX
参数的内容不是固定的。
我想这个页面载入时自动转到
http://localhost/update.aspx?ver=936TWL5.21&yid=-1
html页面上该写什么代码实现?谢谢大家
http://localhost/update.html?ver=936TWL5.21&yid=-1
看出他带有一些参数ver=XXXXX&yid=XXXXXX
参数的内容不是固定的。
我想这个页面载入时自动转到
http://localhost/update.aspx?ver=936TWL5.21&yid=-1
html页面上该写什么代码实现?谢谢大家
在你的update.html的<head></head>中加上如上代码:<head>
<script type="text/javascript">
function getQueryString(){ var result = location.search.match(new RegExp("[\?\&][^\?\&]+=[^\?\&]+","g")); if(result == null){ return ""; } for(var i = 0; i < result.length; i++){ result[i] = result[i].substring(1); } return result;
}
this.location="http://localhost/update.aspx?"+getQueryString();
</head>这就OK了
不需要,还是用JS获取querystring比较方便呵呵
var po=href.lastIndexOf('?');
var paremater = href.substr(po,href.length-po);//截字符串获取参数
window.location.href='http://localhost/update.aspx?'+paremater ;// 跳转直接手敲的,要我做的话大概就是这样的,有错误再改改
window.location.href=window.location.href.replace('.html?','.aspx?')
再不就复制.aspx的执行文件,新建一个.html的,执行文件就填写复制的.aspx的那个
很多,context.writerpath
urlreqwriter重写URL