0
我想創建一個表單,用戶可以把一個數,如「12345」,並點擊提交按鈕時,有結果會http://www.URL.com/12345我需要幫助的形式提交,請閱讀詳情
我想創建一個表單,用戶可以把一個數,如「12345」,並點擊提交按鈕時,有結果會http://www.URL.com/12345我需要幫助的形式提交,請閱讀詳情
待辦事項你需要將這些數據發佈到某個地方,或者你只是想跳到那個位置? 你可以嘗試沒有一種形式:
<label for="number">Number: </label>
<input type="text" id="number" /><br />
<input type="button"
onclick="window.location='http://www.URL.com/'+document.getElementById('number').value;" />
這裏的jQuery的版本分離標記的事件。演示可以看出here
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script>
var url="http://www.url.com/";
$(document).ready(function(){$("#go").click(function(){
url+=$("#parameter").val()
window.location=url;
});
});
</script>
</head>
<body>
<input type="text" id="parameter"/>
<button id="go">Go</button>
</body>