jSQL.js
function(query, data, successCallback, failureCallback) {
			if(typeof successCallback != "function") successCallback = function(){};
			if(typeof failureCallback != "function") failureCallback = function(){ return _throw(new jSQL_Error("0054")); };

			var i, l, remaining;

			if(!Array.isArray(data[0])) data = [data];
			remaining = data.length;
			var innerSuccessCallback = function(tx, rs) {
				var i, l, output = [];
				remaining = remaining - 1;
				if (!remaining) {
					for (i = 0, l = rs.rows.length; i < l; i = i + 1){
						var j = rs.rows.item(i).json;
						//j = JSON.parse(j);
						output.push(j);
					}
					successCallback(output);
				}
			};
			self.db.transaction(function (tx) {
				for (i = 0, l = data.length; i < l; i = i + 1) {
					tx.executeSql(query, data[i], innerSuccessCallback, failureCallback);
				}
			});
		}
function(query, data, successCallback, failureCallback) {
			if(typeof successCallback != "function") successCallback = function(){};
			if(typeof failureCallback != "function") failureCallback = function(){ return _throw(new jSQL_Error("0054")); };

			var i, l, remaining;

			if(!Array.isArray(data[0])) data = [data];
			remaining = data.length;
			var innerSuccessCallback = function(tx, rs) {
				var i, l, output = [];
				remaining = remaining - 1;
				if (!remaining) {
					for (i = 0, l = rs.rows.length; i < l; i = i + 1){
						var j = rs.rows.item(i).json;
						//j = JSON.parse(j);
						output.push(j);
					}
					successCallback(output);
				}
			};
			self.db.transaction(function (tx) {
				for (i = 0, l = data.length; i < l; i = i + 1) {
					tx.executeSql(query, data[i], innerSuccessCallback, failureCallback);
				}
			});
		}
function ( query , data , successCallback , failureCallback ) { if ( typeof successCallback != "function" ) successCallback = function ( ) { } ; if ( typeof failureCallback != "function" ) failureCallback = function ( ) { return _throw ( new jSQL_Error ( "0054" ) ) ; } ; var i , l , remaining ; if ( ! Array . isArray ( data [ 0 ] ) ) data = [ data ] ; remaining = data . length ; var innerSuccessCallback = function ( tx , rs ) { var i , l , output = [ ] ; remaining = remaining - 1 ; if ( ! remaining ) { for ( i = 0 , l = rs . rows . length ; i < l ; i = i + 1 ) { var j = rs . rows . item ( i ) . json ; //j = JSON.parse(j); output . push ( j ) ; } successCallback ( output ) ; } } ; self . db . transaction ( function ( tx ) { for ( i = 0 , l = data . length ; i < l ; i = i + 1 ) { tx . executeSql ( query , data [ i ] , innerSuccessCallback , failureCallback ) ; } } ) ; }
private function to execute a query
private function to execute a query