我想檢查window.location,如果有「IsReload = True」關鍵字,我將刪除它。例如:這是我的了window.location:如何刪除jQuery中的window.location上的一個部分
http://localhost/Demo/User/ManagedUsersTab?isReload=True
我想刪除,並沒有刷新頁面,只是將其刪除「isReload =真實的嗎?」。我該怎麼做。這是我的代碼片段:
if (window.location.href.indexOf("?isReload=True") > -1) {
window.location.replace('@Url.Action("ManagedUsersTab", "User")');
}
這個片段重新加載頁面
'window.location.href.split( '?')[0]' – adeneo
改變'location.href'導致頁面重新加載。 –