今天再做項目演示的時候,用的是ie瀏覽器報錯404,項目都運行好久了,第一次用ie就這樣了悲劇,貼下解決方法吧
function getContextPath() { var pathName = document.location.pathname; var index = pathName.substr(1).indexOf("/"); var result = pathName.substr(0,index+1); return result; } window.location.href=getContextPath()+"/jurisdiction/jumpAddAccessPath.action;