I am using this button to insert data into a storage database:
However, although the rows are being inserted, all the data is undefined. Here is the insert statement:HTML Code:<div class="bookmark"><input type="button" class="addBM" value="Add Bookmark" onclick="insertRow('100', window.location.pathname, document.title)"></div>
What's the proper syntax to carry the data to the DB? There are no errors in the console, and the alert pops up at the right time.Code:function insertRow() { db = window.openDatabase("Database", "1.0", "Bookmarks", 200000); db.transaction(function(tx) { var id; var filename = window.location.pathname; var title = document.title; tx.executeSql("insert into BOOKMARKS(id, filename, title) values(?,?,?)",[id, filename, title]); }, errorCB,successCB()); alert('Bookmark added.'); }



Reply With Quote
Bookmarks