Hi, I'm creating a javascript object and part of the job of it is to
abstract out the interaction with the Safari javascript database and
execute Sql.  I have this method:

getMessages: function() {
        var container;
        var transactionFunction = function (transaction) {
                var successCallback = function(tx, result) {
                       //populate container
                }
                var errorCallback = function(tx, result) {}
                transaction.executeSql('SELECT * FROM message', [],
successCallback, errorCallback);
        }
        this.systemDB.transaction(transactionFunction);
        return container;
}

The problem is that since executeSql runs asynchronously, container is
never populated and the return statement returns undefined.  In
xmlhttp calls, I can just force it to run synchronously and the return
value is fine.  Is there a way to force executeSql to run
synchronously or design the function so that getMessages does actually
return the messages?  Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to