Javascript 重新加载时重定向到基本url

Javascript 重新加载时重定向到基本url,javascript,jquery,url,Javascript,Jquery,Url,我有一个使用Struts 2的web应用程序,当一个操作返回错误时,它将重定向到index.action?notSupported=true。是否有办法从这里重新加载到index.action而不是index.action?notSupported=true,再试一次 window.location.href=window.location.href.substr(window.location.href,window.location.href.indexOf('?')) 希望这有助于

我有一个使用Struts 2的web应用程序,当一个操作返回错误时,它将重定向到
index.action?notSupported=true
。是否有办法从这里重新加载到
index.action
而不是
index.action?notSupported=true
,再试一次

window.location.href=window.location.href.substr(window.location.href,window.location.href.indexOf('?'))
希望这有助于