Solved

jQuery Mobile events and variables

Posted on 2013-05-17
3
168 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jquery, dropdown 4 36
(code works) but print excel in Landscape 5 49
jQuery or CSS 9 37
custom jquery validation method 11 12
Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now