![](/img/trans.png)
[英]Delete button doesn't work and have to refresh page to see updated database results
[英]Button to refresh page doesn't work if I have get parameters
我的網站上有這個按鈕
<input class="large button gray input" id="refrescar" type="submit" value="Confirmar"/>
我用來像這樣手動刷新網站:
$('#refrescar').click(function() {
location.reload();
});
它幾乎適用於我的網頁的所有頁面,除了那些獲得這樣的參數:
http://mywebsite.com/page.php?id=2
當我點擊該頁面中的按鈕時,它將轉到
http://mywebsite.com/page.php
代替。
我怎么解決這個問題?
而不是type="submit"
,使用type="button"
,因為我認為當前按鈕提交表單而不是重新加載它。
是的,你需要改為
<input class="large button gray input" id="refrescar" type="submit" value="Confirmar"/>
至
<input class="large button gray input" id="refrescar" type="button" value="Confirmar"/>
也許
location.reload(location.href);
將url和查詢字符串傳遞給reload函數
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.