Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function setup(tx) {
  2.  
  3. tx.executeSql('DROP TABLE IF EXISTS HEADER_DATA');
  4. tx.executeSql("create table if not exists bookinformation(inserkey TEXT, key TEXT)");
  5. }
  6.  
  7. function dbReady() {
  8. db.transaction(function(tx) {
  9. alert("5");
  10. $.getJSON('http://echo.jsontest.com/key/value/one/two',function(data){
  11. $.each(data, function(i, dat){
  12. tx.executeSql('INSERT OR REPLACE INTO bookinformation (inserkey, key) VALUES("'+data.one+'", "'+data.key+'")');
  13. alert("completed");
  14. });
  15. });
  16. }, errorHandler, function() { alert('added row'); });
  17. }
  18.  
  19. Uncaught InvalidStateError:Failed to execute 'executeSql' on 'SQLTransaction':SQL execution is disallowed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement