Today I got a very strange behavior of my application: I have this function for creating tables, and then, when it succeeds, continue in the code.
db.transaction(function (tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS newsDetail(id unique, title, text, created, createdTS, imageSmall, imageBig, facebook, gameNumber)'); tx.executeSql('CREATE TABLE IF NOT EXISTS lastModified(id unique, ts)'); tx.executeSql('CREATE TABLE IF NOT EXISTS teams(pos unique, name, games, gd, points, s, snv, gl, glo, goals)'); tx.executeSql('CREATE TABLE IF NOT EXISTS players(number unique, name, nickname, birthdate, height, married, children, profession, clubs, position, image)'); tx.executeSql('CREATE TABLE IF NOT EXISTS games(id unique, home, away, score, date, shortDate)'); tx.executeSql('CREATE TABLE IF NOT EXISTS galleryCategories(id unique, name, date, thumb, ordering)'); tx.executeSql('CREATE TABLE IF NOT EXISTS galleryImages(id unique, url, description, catid, ordering)'); tx.executeSql('CREATE TABLE IF NOT EXISTS videos(id unique, url, title, image)'); }, errorCB, function () { loadData('newslist', createNewslist, true); loadData('refresh', loadNewOnes, true); });
Now the problem is that the Succes callback function is called 8 times. Why is this? I have been using this code for several months and have never encountered this problem before. Has anyone ever come across anything like this? Any help is appreciated.