-1

How to get browser back link using Struts2 sj tags... i already tried this code....

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
     $(document).ready(function() {
         $("#login").click(function() {
             alert('HKIiu');
             var currentPage = 1;
             setupPage(currentPage + 1);
             history.pushState(currentPage, document.title, '?x=' + currentPage);
         });
     });
     onpopstate = function(event) {
         alert('Hi2');
         setupPage(event.state);
     };
     function setupPage(page) {
         alert('Hi3');
         currentPage = page;
         document.title = 'Poliopedia' + currentPage;
         document.links[0].href = '?x=' + (currentPage + 1);
         return false;
     }

<sj:a href="login/loginPage.jsp" targets="loginDiv" id="login">Login</sj:a>

but this doesn't helped me......

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
Hariprasath
  • 828
  • 4
  • 15
  • 41

1 Answers1

0

Back link href attribute should have "javascript:history.back()" value instead of just "history.back()" as said Roman C. It works properly for me.