Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

RSH and browser back button

Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used RSH to implement the in-page switch. RSH works fine with the browser "back" button

But when I navigate away and come back by using the browser "back" button, it always go back to the first tab even though the URL is correct: For this example, I expect it will go back to the fourth tab ( tab index start from 0).

I use following code:

As can be seen from the code above, I retrieved the hashed value ( the tab index in this case) from the URL, and select the tab mandatorily. It still does not work: given the sample URL above, it always go to the third tab ( Tab index == 2).

Any idea?

Kevin manoj
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figure it out. It is a stupid error.

It seems that tabs('select', index) only accept integer as the type of parameter index. SO i made following change and it works.

$(".wirelessPlansTabs > .tabs").tabs('select', parseInt(tabIndex));

And this makes me really confused. Because in RSH's listener, I use following code :
function historyChange(newLocation, historyData)
$(".wirelessPlansTabs .tabs").tabs();
$(".wirelessPlansTabs .tabs").tabs("select", newLocation*1);
it works fine. but it does not work with parseInt().

You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic