File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes jquery back reloading the content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery back reloading the content" Watch "jquery back reloading the content" New topic

jquery back reloading the content

Ed Charles

Joined: Feb 20, 2013
Posts: 4
Hi, I'm new to jquery and JavaScript and am just playing around trying to code a simple mobile app. I was hoping someone could point me to a useful tutorial/resource so I can figure out how to code the following behaviour.

I have one HTML file and it contains 3 pages -
page 1: a user input page;
page 2: a read only verify page for user to verfy details entered page 1
page 3: a confirmation message

Page 2 has an edit button in case user made a typo. I've coded the edit button so when clicked it goTos page1.

For example I have an input field of userName and the user types 'Ed'. They select continue and page 2 is shown with 'Ed' displayed in read only mode. The user decides 'Ed' is not right and they choose to edit. Page 1 is reloaded and user now enters 'Edward'. On hitting page 1's continue, page 2 is displayed for the second time but 'Ed' is still displayed. If i then select confirm page 3 does display 'Edward'. When i debug I notice the second time in to page 2 the breakpoint is not hit in the function so i'm guessing the page is being reladed from a cache.

So as I'm new to this I was wondering if there is a good tutorial on when to use goTo, goBack and how to ensure the page is reloaded but you can still pull in the old content the user entered. I did try window reload but that reset everything.

Thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63837

I'm confused. If you have three "pages" in one HTML file, then what's all the "reloading"? The only reason to put multiple screens in one HTML is to be able to swap them out without needing to do any actual reloading.

Is this based on some mobile framework like jQuery Mobile, or are you rolling your own? (I know you mentioned jQuery, but jQuery and jQuery Mobile are very distinct products.)

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: jquery back reloading the content
It's not a secret anymore!