我試圖獲取一個頁面,當(dāng) URL 更改時,它會立即重新加載并使用 URL 中的參數(shù)。第一個網(wǎng)址是:http://localhost/victorphp/Callvisor/bp/index.php由于某種原因這不起作用:<a href="http://localhost/victorphp/Callvisor/bp/index.php?section=user&Mpage=tools" onClick="window.location.reload" >Test</a>當(dāng)我單擊鏈接時,頁面將重新加載,而無需參數(shù)。
1 回答

慕萊塢森
TA貢獻(xiàn)1810條經(jīng)驗 獲得超4個贊
嘗試將 id 添加到您的鏈接中
<a href="http://localhost/victorphp/Callvisor/bp/index.php?section=user&Mpage=tools" id="1" onClick="loadUrl(this)" >
Test
</a>
在 js 文件中創(chuàng)建函數(shù) loadUrl()
function loadUrl(lid){
var url=document.getElementById(lid.id).href;
location.href=url;
}
- 1 回答
- 0 關(guān)注
- 187 瀏覽
添加回答
舉報
0/150
提交
取消