i want to load an external page (so without using ajax from query mobile), the problem is that when i use a function activated by a click on a link tag , and in this function i have an INSERT into a database, the link is followed BEFORE the script writes into the DB..
here's a portion of the code:
$('#aggiungiClienteRubrica').click(function() {
db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
db.transaction(function(tx){
var sql = 'INSERT INTO CLIENTI (nome, cognome) VALUES ("'+$('#nome').val()+'", "'+$('#cognome').val()+'")';
tx.executeSql(sql)}, errorCB);
});
and in the html file i just have an tag like this:
<a id="aggiungiClienteRubrica" href="../client/consultClients.html" data-role="button" data-theme="b" rel="external">Add client</a>
so the problem is that, i can exec the javascript, but asyncronous call that INSERTs into db the record is not executed and the ../client/consultClients.html page is loaded
How can i make it follow the link AFTER job is done??