Disregarding the API calls to sqlite in the following code, I want to reference selectLocation as a variable that returns the JSON object for later manipulation. I realize I cannot return this within the nested db.transaction closure, which is why I used the variable jsonOut to grab the object after it was assembled. The call to console.log("In:" + JSON.stringify(json)) writes out the expected value, but unfortunately, when I try assigning selectLocation to a variable, I get that it is undefined. Am I barking up the wrong tree to get my object?
var selectLocation = function () {
var SelectStatement = 'SELECT * FROM site s '
+ 'INNER JOIN evaluation e ON s.site_id = e.site_id '
+ 'ORDER BY s.site_id ';
db.transaction(function (transaction) {
transaction.executeSql(SelectStatement, [], function (transaction, result) {
if (result !== null && result.rows !== null) {
vari = 0,
max,
row,
location,
complete,
notExists,
category,
jsonToEvaluate = []; // initialize as a collection
for (i = 0, max = result.rows.length; i < max; i += 1) {
I want to see how the models are defined for the sample app at http://jquerymobile.com/test/docs/pages/backbone-require.html ... where can I find the source code for this? Also, besides https://github.com/jquery/jquery-mobile/pull/5205, does anyone know of any other good examples out there of a JQM/Backbone app? I am about to embark on rewriting my project from JQM/Phonegap into a JQM/Phonegap/Backbone/Require app and want as many sample apps to examine in gory detail before i embark on my journey.
I am trying to do a form reset, but am unable to get it working. I think I may have the answer: My form is split into multiple pages using page divs ... nothing seems to work to clear all form elements across all defined "pages." I played around with this a bit in jsfiddle, but it doesn't seem to render going between page divs too well. Anyway, I tried it within a single page div and it worked fine. Here is a snippet of my HTML:
But, it does not do anything in my form (in particular, clear checkboxes and set multiple-selects to the blank value). I have even changed the form tag to a simple <form>.
Any ideas as to what boneheaded thing I have overlooked in implementing this code into my app?