JQuery :: 1.4 Restoring Page State On Back Button?

Jan 22, 2010

In Mac Safari 4.04 & Firefox 3.6, I am seeing page state being persisted on back button to page. I couldn't reproduce on jquery 1.3.2.

Here's a simple example:

<html>
<body>
<script type="text/javascript" src="jquery-1.4.js"></script>
<a href='#content1'>tab 1</a> <a href='#content2'>tab 2</a>

[Code]....

1. Click on one of the anchors.

2. Goto another page

3. Click the browser back button

Result: One of the sections is still hidden. Is anyone else seeing this? How is jquery doing this?

View 3 Replies


ADVERTISEMENT

JQuery :: Lost Page State After Pressing Back Button?

May 22, 2010

I have a page where a user can progressively download more thumbnail images. New thumbnails are loaded using '$.get' followed by an 'append' to the main thumbnail container. If a user clicks on a thumbnail then they link to another page to see the full size image. If the user then presses the back button, the page of thumbnails has returned to its initial state. I was hoping that all the additionally downloaded thumbnails would remain in memory! Is there a way around this? Keeping track of any additional thumbnails that have been downloaded when navigating the to the full size image page and then re-loading them when the user returns to the thumbnails page is not really an option as I don't want the user having to wait for this. This is what facebook appears to do after one has loaded lots of additional items on their news feed - if one links to another page and hits the back button, my suspicion is that all the items are re-loaded - they're not just re-displayed from memory.

View 2 Replies View Related

Separation Between View And State (The Back Button)

Jul 13, 2006

Let's say you have a "Buy" botton that posts a form to a script that
inserts or increments the quantity of a record in a shopping cart
table. So you click "Buy" and then "Checkout". Now if you hit the Back
button it asks the user if they would like to repost the form. If they
click "Ok" the db script runs again and now they have two items in
the cart.

It seems to me this is a fundamental model view controller kind of
problem. There's no seperation between the view and the controller. Can
someone recommend a generic method for providing that seperation? I could
have the script emit a Location header but that's a strange hack. What
is the definitive method for solving this probably very common issue?

View 1 Replies View Related

Set Js Function Back To Initial State When Page Is First Loaded?

Jun 9, 2011

I have a scripts which filters a list of data based on a users selection from dropdowns in a form. The script updates a counter while the user is making the selections and also colates a url string which I then use to query a php db when the user clicks view results.

I also have a reset button in the form so the user can quickly go back to the start. When this is clicked it does reset all the dropdowns and inputs to their defualt values but it doesn't reset my js functions back to their initial states.

Can anyone tell me how I can do this? Is there a js reset function I can use?

View 1 Replies View Related

Detect Back Button - True To Not Let The Page Load And Kick Them Back X Number Of Pages

Feb 24, 2004

I am trying to write a script that uses the IF statement to see wether or not a user clicked the back button to come to a page, and then if it's true to not let the page load and kick them back X number of pages (say 4) This is what I have so far:

<script language="JavaScript"><!--
if javascript:window.history.back == 1
{
javascript:window.history.back(4);
return false;
}
//--></script>

View 14 Replies View Related

JQuery :: Second Page Has No Back Button

Dec 14, 2011

Im working with O'Reileys jQuery Mobile Book. I made the first steps and got the first problem..My second page has no Back Button

[Code]...

View 2 Replies View Related

JQuery :: Unique Url And Browser Back Button In An Ajaxified Page

Jul 2, 2009

Unique url and browser back button in an ajaxified page

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#666666">
<font size="-1"><font face="Calibri">Hi,

Does jQuery provides any feature or plugin to handle unique url andbrowser back button in an ajaxified page.

[Code]...

View 1 Replies View Related

JQuery :: Stopping Back Button From Refreshing The Page And Undoing All The User Actions?

Aug 25, 2010

I have a number of pages that organize book data by category and then by unit, chapter, section, etc... Since there is a ton of data I display the headings and hide the rest of the content for the category. When a user clicks the heading then the content for the heading is shown underneath it. This works great and the users don't have to scroll (at least not much in comparison to if everything on the page was visible) unless for some reason they expand tons of stuff.

The problem:My company wants it so that if they expand a bunch of stuff and then browse to another page, that when they click the back button, everything should still be expanded as they left it. The issue is, this content is only available to logged in users and is based on their current location (which they can change at any point), so if their session expires or they logout, using the back button to get to these pages needs to redirect them to the login screen, if they change pages and change their location, going back to this page needs to display the correct content for their location. It is kind of a catch-22. Of course in the eyes of my company "shouldn't it just work that way?"

View 2 Replies View Related

Going To The Top Of The Page When Using The 'back' Button

Jan 27, 2007

how do i make the page go all the way to the top after you press the back button?

for example, you would go to page 1 and you scroll mid-way, then you press a link to page 2. then you press the back button on page 2 and takes you back to page 1 but it brings you back to the section where you scrolled mid-way.

is there any way to make it so it will automatically bring you to the top of the page. ive seen it on other sites.

View 6 Replies View Related

Hit Back Button - Go To TOP Of Page

Aug 3, 2010

after hitting 'back' button I'm taken to spot on page where I was, but I'm being asked to do the opposite -- take user to the top of the page, after hitting 'back' button... when I look up this issue, most people complain of the opposite - that the browser takes them to to top of the page after hitting 'back' button...;-) [URL] is there a way with JavaScript to force page to go to the top of the page when you navigate to a back via 'back' button?

View 3 Replies View Related

Back Button Detect With Same Page In History

Nov 27, 2009

I have a photo gallery that cycles images using custom buttons and replacing images from an javascript array. I do this so that I don't reload the page each time, just put up the next image so the next image (preloaded) appears instantly. I change the URL to include the image name so that it can be saved, linked, sent etc.

If I load the page and cycle through some pictures and then use the back button I can't find a way of detecting this and putting up the previous image - it just changes the URL in the browser and eventually unloads the page when it should.

View 4 Replies View Related

Browser Back Button On A Page Using Iframe Content?

Feb 1, 2011

when you have a page that contains an iframe, and then navigate inside the iframe, hitting the browsers back button will only affect the contents of the iframe and not the entire page. I've been searching all over for solutions and cant find one that works for my current implementation.


function ShowPage(frame)
{
frames[0].location = frame+'.html'
frame.contentWindow.location.replace(newUrl);
}
[Code]...

View 4 Replies View Related

Ajax :: Program A Back Button For A Page That Uses Html5?

Sep 28, 2011

Anyone has code to program a back button for a page that uses html5 and AJAX?

View 2 Replies View Related

Detect Browser Back Button Press With No Page Reload?

Nov 23, 2010

I am trying to trigger an event once the user clicks the browsers back/forward buttons, I have built a system just like facebook where if the user has javascript turned on they get the full feature of the site which includes fast switching for example if someone goes to this page "example.com/index.php" and click a link to contact.php it would change the url to "example.com/index.php#!/contact.php" but what I need to know is if there is any way to change the pages content when the user goes back and forth through the fast switch pages? something like "history.back !== -1" or something like that.

View 2 Replies View Related

JQuery :: Using "window.location" For Link But Back Button Does Not Refresh Initial Page?

Nov 1, 2011

Here is the url:The issue, as you will see, is initially when my front page loads the "menu" animates into place. Then after a button is clicked:

$(".home_button").click(function() {
$('#content_menu').stop().fadeOut(1000,function() {
window.location = "http://jquery.com/";

[code]...

That all works fine. The issue is when I use the back button on the browser to return to the home page the animation never triggers and the page remains unusable until a refresh. How can I have this page refresh when the user uses the back button and/or is there a better way to do what I'm asking?

View 1 Replies View Related

Having A Lightbox Pop Up When A User Clicks The Back Button In Their Browser Rather Than Just Navigating Back

Jul 1, 2011

I'm looking to have a lightbox pop up when a user clicks the Back button in their browser rather than just navigating back. The purpose is to ask a question with a Yes/No answer, and if they click No, I allow them to go back. The only thing I've found anything like this is the onUnload event, but that doesn't prevent them from going back. How should this be handled?

View 1 Replies View Related

Firefox - When Click Browser Back Button On Load Is Not Executed And Page Is Rendered From Cache

Aug 20, 2011

How you handle back button scenario in firefox browser. The problem is when i click browser back button , the javascript on load is not executed and page is rendered from cache.

View 1 Replies View Related

JQuery :: Button Widget Won't Return To Ready State In IE8 But Does In FF

Mar 15, 2011

I am chaining a .click function to the .button jquery UI widget. I get the action I want just fine but the in IE8 the button does not return to the ready state after I click. It works fine in FF.

$('#myButton').button()
.click(function () {
$('#total').text('here it is');
})

[Code].....

View 2 Replies View Related

JQuery :: Cookie Plugin To Remember The State Of A Navigation Menu From Page To Page

May 19, 2011

I'm trying to use the cookie plugin to remember the state of a navigation menu from page to page. Here is the snippet of code from towards the top of my page where I am including the jquery files and cookie plugin. The second part of the sample tries to determine whether the cookie exists.

[Code]....

View 1 Replies View Related

JQuery :: Redirecting The Back Button If The "back URL" Is Xyz.com?

Sep 14, 2010

I am trying to capture the back button and redirect if it is a certain URL, if not just go back like a normal back button.I've never really messed with the history except for something like this: <a href="#" onClick="history.go(-1)">Anyone have an example using this plugin: [URL]r any other plugin that might achieve this

View 1 Replies View Related

Refresh Page After Clicking "Back" Button?

Feb 7, 2007

I have a page that is dynamically build through DOM manipulation. So, when I browse outside the page, and then click back, those dynamically created DOM objects are gone. I can rebuild the page easily. So the point is that if the user leaves the dynamic page, then clicks back on their browser, I need the page they are going back to to refresh. I thought it might be something about caching, so I've tried to use all following 3 META tags but it doesn't work.

Code:
<meta http-equiv="Pragma" content="no-cache">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Expires" CONTENT="-1">

View 14 Replies View Related

JQuery :: Why Does The Hover State Return To The Initial State

Nov 1, 2011

I used the code from the following article...[URL]

$(function() {
$('img[data-hover]').hover(function() {
$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover',

[code]...

why does the rolled over image's src return to the original value when the user rolls back off it?

View 1 Replies View Related

3 State Button Not Working ?

Mar 5, 2009

I'm trying to get my website 'apps-limited uk' to have working 3 state mouse buttons which are selectable by tab, accesskeys, etc...For some reason the 3rd state shows fine in Safari (3.22), not at all in IE(All - IE Tester) or FF(3.0.5), and god only knows what's happening in Opera (9.63)The javascript is here at the root, and is called rollover.

View 14 Replies View Related

JQuery :: Div Should Open State When Page Load?

May 24, 2011

I have jquery issue, Kindly see my jquery code:

[Code]...

My .toggle_container is first time hidden, its good. BUT when I click on the link inside .toggle_container and navigate to another page or when page is load then my .toggle_container become hidden. I want to make it visible/open state. Can you please provide me any solution?

View 4 Replies View Related

JQuery :: Accordion Initial State After Page Changes?

Dec 15, 2008

I'm stuck with a simple jquery accordion script that is[URL]..The problem is that there are links inside my divs that brings to another page where the same accordion menu should be included and left opened at the same state like the previous page (hope to be enough clear. The script I'm using will always close all the accordion divs upon the second page load. I'm a total newbie of jquery and couldn't understand exactly how jquery works (among other things I've to do i promise that I will learn jQuery as soon as possible );

[Code]...

View 2 Replies View Related

JQuery :: Keep Div State After Posting Page And Returning?

Apr 11, 2010

I have a jQuery script which shows a specified div based on the select chosen from the dropdown list.The problem im having is how to retain the div state after the page has been posted and then returned too,

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){

[code]....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved