javascript - Check a Boolean value from database at the start of an app then load terms and condition page if false, load menu page if true -
is possible? before page loads, run javascript code check value in database is, open relevant page? here code far: function ondeviceready() //phone gap ready { try { db = opendatabase('cuopioid', '1.0', 'cupioids application database', 2 * 1024 * 1024); } catch (e) { // error handling code goes here. if (e == invalid_state_err) { // version number mismatch. alert("invalid database version."); } else { alert("unknown error " + e + "."); } } console.log("database created!"); db.transaction(createtableterms, errcb, console.log("medicines table created!")); $('#btnaccept').on('click', acceptterms); } the code below creates database (if isn't there already) function createtableterms(tx) { tx.executesql('create table if not ...