我想提交一個表單使用get方法,但我不希望窗體刷新或更新時,我想維護數據。似乎有很多類似的問題,但我沒有嘗試過幫助。我在這裏發佈我的代碼:防止頁面重新加載表單提交
<script type="text/javascript">
function formSubmit()
{
document.getElementById('form1').submit();
return false;
}
</script>
<form id = "form1" method = "GET">
<br> Query: <input name="query" id="query" type="text" size="50" value="">
<input type="button" name="search" value="Get News" onclick = "formSubmit()">
</form>
我在服務器端使用python。
感謝
Google for'Ajax'。 – VisioN