0

I really am stuck here. I am trying to get data from a VB Web Method whilst in javascript. To do this, I do this, an ajax call runs everytime a certain button is clicked.

The problem im having is, once clicking the button on the 2nd or 3rd time, the application crashes and goes back to the main ipad screen.

I am running this on Icenium Ion and using the SQLite Plugin. Here is the method run on button click

app.createTable = function() {
    var db = app.db;
    db.transaction(function(tx) {
        tx.executeSql("DROP TABLE IF EXISTS products", []);
        tx.executeSql("CREATE TABLE IF NOT EXISTS products(ID INTEGER PRIMARY KEY ASC, column1 TEXT, column2 TEXT, column3 TEXT, column4 TEXT, column5 TEXT, column5 TEXT, column6 TEXT, column7 TEXT, column8 TEXT, column9 TEXT, column10 TEXT, column11 TEXT)", []);
    });

    $.ajaxSetup({ cache: false });


    $.ajax({
        type:'POST',
        dataType:'json',
        contentType:'application/json',
        url:getProductsURL,
        cache:false,
        error: function(x, t, m) {
            if (t==="timeout") {
                alert("got timeout");
            }
            else {
                alert(m);
            }
        },
        success: function(x)
        {
            $("#doneStartUpdate").text("Data Fetched Successfully");
        }
    })
    .done(function(response) {

        alert("done");
    })
}

Thank you

user2681625
  • 131
  • 3
  • 18

0 Answers0