[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

jQuery Mobile events and variables

Posted on 2013-05-17
3
Medium Priority
?
185 Views
Last Modified: 2013-06-18
Hi all!

I have almost finished the 1st part of my 1st web app...

I have serious problem with understanding how to handle JQM events and variables that should work for the entire page.

My app is here:

http://pitto.homeip.net/mobile

The problem is that when I select any customer in the 1st page I land on a detail page where I can add payments simply tapping on the month name.

Insert (or delete) in the database happens perfectly but my page refresh function doesn't work properly because I "lose" my variables from one function to the other.

I've tried using global variables like $.myVariables.variable without luck.

Something is wrong also probably with my events...

I do everything for the details page in the pagebeforeshow because if I use the pageinit it stops working.

Can someone provide specific help or, if not possible, also generic info? I am pulling my hair from days.
0
Comment
Question by:ltpitt
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39233363
Hi,

Is this a single page application? If not, JavaScript variables will be lost. I also suggest you to check Knockout - http://knockoutjs.com/

Hope it helps u...
0
 
LVL 1

Accepted Solution

by:
ltpitt earned 0 total points
ID: 39246987
Acutally it was easier than that...

I simply had to declare variables at the beginning of the script (and not in the function).

This way variables are validated for all the page.

:)
0
 
LVL 1

Author Closing Comment

by:ltpitt
ID: 39255646
Nobody else provided correct information
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question