如题所述
JSæ¹å¼å®ç°éæ页ä¹é´å¼ä¼ éï¼åèå¦ä¸ï¼
å¨bodyæ ç¾ä¹é´å æ¤è¡ä»£ç ï¼
<form action=âa.html?d1=123&d2=ä½ å¥½â method=âpostâ name=âf1â³ id=âf1â³>
<input type=âsubmitâ name=âs1â³ id=âs1â³ value=âæ交â/>
</form>
ç¶åï¼æ°å»ºa.htmlæ°é¡µï¼åæ ·å¨bodyæ ç¾ä¹é´å æ¤è¡ä»£ç ï¼å¦ä¸ï¼
<script type=âtext/javascriptâ>
var tmpArr;
var QueryString;
var URL = document.location.toString();
if(URL.lastIndexOf(â?â)!=-1){
QueryString= URL.substring(URL.lastIndexOf(â?â)+1,URL.length);
tmpArr=QueryString.split(â&â);
for (i=0;i<=tmpArr.length â 1;i++) {
document.write(âåæ°ä¸ºï¼â + tmpArr[i] + â<br/>â);
}
}
else{
QueryString = ââ;
}
</script>
å¨bodyæ ç¾ä¹é´å æ¤è¡ä»£ç ï¼
<form action=âa.html?d1=123&d2=ä½ å¥½â method=âpostâ name=âf1â³ id=âf1â³>
<input type=âsubmitâ name=âs1â³ id=âs1â³ value=âæ交â/>
</form>
ç¶åï¼æ°å»ºa.htmlæ°é¡µï¼åæ ·å¨bodyæ ç¾ä¹é´å æ¤è¡ä»£ç ï¼å¦ä¸ï¼
<script type=âtext/javascriptâ>
var tmpArr;
var QueryString;
var URL = document.location.toString();
if(URL.lastIndexOf(â?â)!=-1){
QueryString= URL.substring(URL.lastIndexOf(â?â)+1,URL.length);
tmpArr=QueryString.split(â&â);
for (i=0;i<=tmpArr.length â 1;i++) {
document.write(âåæ°ä¸ºï¼â + tmpArr[i] + â<br/>â);
}
}
else{
QueryString = ââ;
}
</script>
温馨提示:答案为网友推荐,仅供参考