html页面互相传值的问题解决方案
(编辑:jimmy 日期: 2024/11/30 浏览:3 次 )
第一次使用随笔,感觉还是蛮别扭的
a.html
复制代码代码如下:
<html>
<head>
<title> demo </title>
<meta name="Author" content="xugang" />
</head>
<body>
<FORM name="frm" METHOD="get" ACTION="b.html" onsubmit="return foo()">
<INPUT TYPE="hidden" id="hid" value="123" name="hid">
<INPUT TYPE="submit" value="提交">
</FORM>
</body>
</html>
b.html
复制代码代码如下:
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
document.write(location+"
");
document.write(location.search+"
");
document.write(decodeURIComponent(location.search.substr(location.search.indexOf("=")+1)));
</SCRIPT>
</BODY>
</HTML>
a.html
复制代码代码如下:
<html>
<head>
<title> demo </title>
<meta name="Author" content="xugang" />
</head>
<body>
<FORM name="frm" METHOD="get" ACTION="b.html" onsubmit="return foo()">
<INPUT TYPE="hidden" id="hid" value="123" name="hid">
<INPUT TYPE="submit" value="提交">
</FORM>
</body>
</html>
b.html
复制代码代码如下:
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
document.write(location+"
");
document.write(location.search+"
");
document.write(decodeURIComponent(location.search.substr(location.search.indexOf("=")+1)));
</SCRIPT>
</BODY>
</HTML>
下一篇:HTML中select标签单选多选用法详解