Q: Return to a specific tab after page reload I have a page made with Bootstrap 3 framework that contains two tabs.
I have a button which when clicked opens the second of the two tabs. This works fine but now I want the entire page to reload after the button is clicked and then open the second tab it does not work (the page just reloads and stays on the first tab. Why does this not work?
//This works
$('button').click(function(){
  $('a[href="#credits"]').tab('show');
});



 //This doesn't work
    $('button').click(function(){
//reload entire page
      location.reload();
      $('a[href="#credits"]').tab('show');
    });


A: When you call 'reload' it's like you request the page for the first time.
When I had a similar problem, I ended up setting a cookie, then I could read that cookie to determine whether it's the first load or a reload.
Hope you can use that idea.
