index.htm
open.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<input type="hidden" id="input" value="str">
<input type="submit" value="跳转" onClick="window.open('open.htm','','');">
</body>
</html>open.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<script>
var obj = window.opener.input.value;
document.write("这是从index.htm的input上传过来的值\""+obj+"\"");
</script>
</body>
</html>
本文介绍了一个简单的HTML页面示例,展示了如何通过隐藏字段在不同页面间传递数据,并利用JavaScript读取并显示这些数据。
4027

被折叠的 条评论
为什么被折叠?



