one page web app, back button takes me to login screen

I have a webapp which uses a lot of Jquery
there are essentially 2 pages
1. login page
2. main page

the main page contains many tabs and it acts as if its going to different pages, but its all one page

the issue i have is the back button takes me to the login page
I would like it to store the tab navigation, and navigate based on where i've been

is this possible, of so how?
websssCEOAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GauthierCommented:
yes, history.pushState
There are also some (very buggy) plugin for jquery which attempt to make it compatible with older browsers:
such as https://github.com/browserstate/history.js/
0
websssCEOAuthor Commented:
thanks
I'm not bothered about supporting old browsers, just HTML 5 compliant ones
can i just call history.pushState on tab clicks?

or do i need to reference a js file that isn't native to HTML5 ?
0
GauthierCommented:
Note that IE9 doesn't support history.pushState
If you decide to use the html5 way, just use
history.pushState and a listener on popstate.
Be carefull of your urls, pushState let you make them up with no server backing.
But think of bookmarking, hard refresh, SEO. What you can do is constrained by your framework (URL rewrite) server side, you may need to use # to make it simpler.
here is a simple sample:
http://html5.gingerhost.com/london
0
websssCEOAuthor Commented:
thanks man
Its a web app which is used internally

Therefore SEO isn't and issue, and we dont have to worry about IE9

So can i literally call history.pushState on button click?
0
GauthierCommented:
yes, pushState, is ok, but don't forget the popstate listener or the back button won't do anything :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Applications

From novice to tech pro — start learning today.