-2
我試圖從一個HTML頁面值傳遞給另一個html頁面,但我得到了一些錯誤..如何將數值從一個html頁面傳遞到使用javascript的另一個html頁面?
下面是我的html頁面一個代碼:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function first() {
location.href = "onclick2.html";
}
</script>
</head>
<body>
<button onclick="first()" >Home</button>
<form action="onclick2.html" method="post">
<input type="text" name="sender" />
<input type="submit" value="send"/>
</form>
</body>
</html>
下面
是我的HTML頁2代碼
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function first() {
location.href = "onclick.html";
}
</script>
</head>
<body>
<button onclick="first()">Home2</button>
<form action="onclick.html" method="get">
<input type="text" name="reciver" />
</body>
你的錯誤是什麼? –
我完全不明白你想要做什麼。你能詳細解釋一下嗎? –
值不會從一頁傳遞到另一頁...... – Dep