This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery back reloading the content" Watch "jquery back reloading the content" New topic
Author

jquery back reloading the content

Ed Charles
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: jquery back reloading the content