I produced a apple iphone Web Application with jQuery &lifier jQTouch, that utilizes the neighborhood SQLite database from the Mobile Safari browser within the apple iphone.

The application was running great, up to a couple of days ago. All of a sudden I recieve the next error message when attempting to initialize the database:

TypeError: Result of expression 'db' [undefined] is not an object.

This error happens while attempting to execute the next code:

function openDB() {     
    db = openDatabase(dbName, '1.0', dbName);       
        function(tx) {  
                'CREATE TABLE IF NOT EXISTS energy_days ' +  
                '  ... (omitted) ... ;',  
                function(tx, error){        
                    alert('Error (CREATE TABLE): '+error.message+' (Code '+error.code+')');  
                    return true;  

Obviously, the variable db is determined globally.

Now, this code segment was working. Maybe it has something related to the most recent the new ios 4.2 update? With this particular update, the entire database behavior got kinda strange (e.g. they aren't visible within the Configurations any longer, before you restart the entire device).

Has anybody a concept how you can fix this? Can there be another method to initialize a database object or shall we be held missing something apparent?

Thank you for all replies, they're sincerely appreciated! Roland

I believe I discovered the issue using the code above. As pointed out, it labored until the upgrade to the new ios 4 (but still does in Safari). Now it appears the JS syntax of the very current Safari Mobile continues to be stiffened.

While using real code snipped from Apple's documentation (including short and display title, size etc.) it once more works in Mobile Safari.