Return to the page and update the data

1

I have a screen that lists my products. To register a new product, I open another screen to insert the data and so make the registration, on this same screen I have a back button, in it I have the code onClick="history.back()" , however when it returns to the list of products, that product that I finished not list, only list when I do a new search. Do you have any way to go back and refresh the list? Something like, history.back() + location.reload() .

    
asked by anonymous 04.06.2016 / 01:31

2 answers

1

Try to replace the history.back () method with location.replace ('your_panel.php') .

If this does not resolve, it is because the homepage logic is not adequate or the AJAX driven script is not doing the insertion. (because you did not post the code and we can only assume).

If the problem persists, do not feel embarrassed to ask +

    
04.06.2016 / 05:10
2

I entered the solution in another forum, follow the link

Solution

<script type='text/javascript'>

(function() {
   if( window.localStorage ) {

      if( !localStorage.getItem( 'firstLoad' ) ) {
         localStorage[ 'firstLoad' ] = true;
         window.location.reload();

      } else {
         localStorage.removeItem( 'firstLoad' );
      }
   }
})();

    
04.06.2016 / 13:54