超链接取值 function GetQueryValue(name) { var reg=new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r=window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return ""; }var ww=GetQueryValue("value") 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 left.html<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <body> <table> <tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr> <tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr> </table> </body> </html> 1.html<script type="text/javascript"> var ww=false;//function:get value after ie address's '?'//use this function:show.htm?id=2 get 'id' value use QueryString("id")function QueryString(qs){ s = location.href; var SharpIndex=s.indexOf("#"); if (SharpIndex!=-1) { s=s.substring(0,SharpIndex); } s = s.replace("?","?&").split("&"); re = ""; for(i=1;i<s.length;i++) { if(s[i].indexOf(qs+"=")==0) { re = s[i].replace(qs+"=",""); } } return re;}function init(){ww=QueryString("value");} </script> function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1')}[html]<script> function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1'); alert(ww);} init();</script>[/html] 非常感谢各位,我要结贴了。大家提供了很多方法,都很管用。只要不放在加载里。index.html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <frameset frameborder="1" cols="30%,*"> <frame name="left" src="left.html"> <frame name="content" src=""> </frameset> <body> </body> </html> left.html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <body> <table> <tr> <td valign="left"> <a href="1.html?1" target="content">1 </a> </td> </tr> <tr> <td valign="left"> <a href="1.html?2" target="content">2 </a> </td> </tr></html> 1.hmtl <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <script language="JavaScript"> var ww = location.href.match(/[^?]+$/);orvar ww=document.URL.match(/[^?]+$/);orww = location.search.replace(/^.*\D(\d+)$/, '$1'); </script> <body onLoad="init()"> <form method="post" name="f1"> <script language="javascript" type="text/javascript"> if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123"> ');} else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456"> ');} else{document.write(' <input id=uiViewApplyButton type=button value="000"> ');} </script></form> </body> </html>如果还含有标记:left.html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <body> <table> <tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr> <tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr></html> 1.hmtl <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document </title> </head> <script language="JavaScript"> function GetQueryValue(name) { var reg=new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r=window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return ""; }var ww=GetQueryValue("value");orfunction QueryString(qs){ s = location.href; var SharpIndex=s.indexOf("#"); if (SharpIndex!=-1){s=s.substring(0,SharpIndex);} s = s.replace("?","?&").split("&"); re = ""; for(i=1;i<s.length;i++){if(s[i].indexOf(qs+"=")==0){re = s[i].replace(qs+"=","");}} return re;}var ww=QueryString("value");</script> <body onLoad="init()"> <form method="post" name="f1"> <script language="javascript" type="text/javascript"> if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123"> ');} else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456"> ');} else{document.write(' <input id=uiViewApplyButton type=button value="000"> ');} </script></form> </body> </html> 跪求大神解决!!!!!!!! 关于decodeURIComponent无法使用 如何根据用户ip地址显示不同页面内容 如何根据文本框控件的内容自动变化文本框控件的宽度 如何做到按回車input集點向下切換? JS动态设置热区 编好了web自由查询界面,纯javascript,共享之 如何用javascript判断文本框输入的是否是数字?急~~~~~~~ 用insertAdjacentHTML插入的元素怎么删除? 如何在窗口变大时,窗口中的表也跟着变大,与窗口有着原有的比例,表不会变形!先谢谢了! 关于超链接传值的问题 在FF下选中checkbox不能改变tr颜色
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<body> <table>
<tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr>
<tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr>
</table> </body>
</html> 1.html
<script type="text/javascript">
var ww=false;
//function:get value after ie address's '?'
//use this function:show.htm?id=2 get 'id' value use QueryString("id")
function QueryString(qs)
{
s = location.href;
var SharpIndex=s.indexOf("#");
if (SharpIndex!=-1) {
s=s.substring(0,SharpIndex);
}
s = s.replace("?","?&").split("&");
re = "";
for(i=1;i<s.length;i++)
{
if(s[i].indexOf(qs+"=")==0)
{
re = s[i].replace(qs+"=","");
}
}
return re;
}function init(){
ww=QueryString("value");
}
</script>
function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1')}[html]
<script>
function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1'); alert(ww);}
init();
</script>
[/html]
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<frameset frameborder="1" cols="30%,*">
<frame name="left" src="left.html">
<frame name="content" src="">
</frameset>
<body> </body>
</html> left.html <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<body> <table>
<tr> <td valign="left"> <a href="1.html?1" target="content">1 </a> </td> </tr>
<tr> <td valign="left"> <a href="1.html?2" target="content">2 </a> </td> </tr>
</html> 1.hmtl <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<script language="JavaScript">
var ww = location.href.match(/[^?]+$/);
or
var ww=document.URL.match(/[^?]+$/);
or
ww = location.search.replace(/^.*\D(\d+)$/, '$1');
</script>
<body onLoad="init()">
<form method="post" name="f1">
<script language="javascript" type="text/javascript">
if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123"> ');}
else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456"> ');}
else{document.write(' <input id=uiViewApplyButton type=button value="000"> ');}
</script></form> </body> </html>如果还含有标记:left.html <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<body> <table>
<tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr>
<tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr>
</html> 1.hmtl <html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document </title>
</head>
<script language="JavaScript">
function GetQueryValue(name)
{
var reg=new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r=window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]);
return "";
}
var ww=GetQueryValue("value");orfunction QueryString(qs)
{
s = location.href;
var SharpIndex=s.indexOf("#");
if (SharpIndex!=-1){s=s.substring(0,SharpIndex);}
s = s.replace("?","?&").split("&");
re = "";
for(i=1;i<s.length;i++){if(s[i].indexOf(qs+"=")==0){re = s[i].replace(qs+"=","");}}
return re;
}
var ww=QueryString("value");</script>
<body onLoad="init()">
<form method="post" name="f1">
<script language="javascript" type="text/javascript">
if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123"> ');}
else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456"> ');}
else{document.write(' <input id=uiViewApplyButton type=button value="000"> ');}
</script></form> </body> </html>