| Page 2 of 2 | [ 15 posts ] | Go to page Previous1, 2 |
|
I should add to my previous message, maybe it would help if I explained what I was trying to do.
1. On page load I want to add a back history to the browser. 2. Only when the user hits back, I want to fire some javascript. My code works perfectly in IE and Firefox, but not in Chrome. Thanks, Again. |
|
The code you've provided so far never calls history.add(), so it's never actually adding a new history entry. If this really is the code you're using (I assumed it was just sample code to explain your problem), then maybe that's the issue?
Unless a new history entry is added, the back button will always return the user to the previous page rather than the previous history state. |
|
I used initialState: {kittens: null,} to add a back element. It works fine in IE and Firefox. I'm I doing something wrong?
|
|
initialState specifies the default state that should be used when a state hasn't been set yet, but it doesn't actually create a history entry. A history entry won't be created until you call add().
|
|
Thanks Ryan, I used history.add() and some other things you said and now it works exactly like I want. Thanks for all your help.
|
| Page 2 of 2 | [ 15 posts ] | Go to page Previous1, 2 |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group