简体   繁体   中英

Back Button Issue

I am struggling with Back button link.

For back button, I am using Back to go to the previous page. This works absolutely fine in Chrome but not in IE and Firefox. In IE it stays on the same page and in Firefox I get "Page Expired" message.

I have a hint of a problem but i don't know the solution.

So my trace of URL is :

/xyz/client/auth/createIDForm.do which redirects xyz/client/pub/redirectByURL.jsp?nextURL=/auth/setQnAForm.do

Now the landing page is xyz/client/auth/setQnAForm.do however the back button on this page is having problem like I have mentioned above.

I think its going back to rediretByURL.jsp ? nextURL=/auth/setQnAForm.do and refreshes the same page however in Chrome.I think the back page is loading from cache.

Please help me in this.

try to use this one

<button onclick="goBack()">previous page</button>
<script>
function goBack() {
if(navigator.userAgent.indexOf("Chrome") != -1 )
    {
        window.history.go(-1);
    }
    else if(navigator.userAgent.indexOf("Safari") != -1)
    {
        window.history.go(-1);
    }
    else if(navigator.userAgent.indexOf("Firefox") != -1 ) 
    {
         window.history.go(-1);
    }
    else if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) //IF IE > 10
    {
      window.location.href="yourPageLink";
    } 


   }
    </script>  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM