<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function subonclick()
{
window.location.href +="&="+aa.value;
}
//-->
</SCRIPT>
<body>
<input type="text" name="aa" value="">
<input type="button" name="bb" value="提交" onclick="subonclick()">
</body>
</html>不过我认为你的最终目的应该是进行form提交,否则这样的结果我看不出你用他会有意义!
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function subonclick()
{
window.location.href +="&="+aa.value;
}
//-->
</SCRIPT>
<body>
<input type="text" name="aa" value="">
<input type="button" name="bb" value="提交" onclick="subonclick()">
</body>
</html>不过我认为你的最终目的应该是进行form提交,否则这样的结果我看不出你用他会有意义!
function getQuery(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]); return "";
}
function mm()
{
var txt = document.all.aa.value;
var url = window.location.href.replace(/(\?|&)=[^&]*/g, "");
window.location.href = url + (url.indexOf("\?")==-1 ? "\?" : "&") +"="+ txt;
}
</SCRIPT><body onload="aa.value=getQuery('')">
<input type="text" name="aa" value="">
<input type="button" name="bb" value="提交" onclick="mm()">