Closed scott-davidjones closed 11 years ago
You could start using a transaction and wait for oncomplete of the transaction, something like
var lookup = $.indexedDB('atlas').transaction([atlas]).done(function(){
// transaction has completed, you are good to go.
})progress(function(){
// transaction is in progress here, do the adding to DB
})
Thanks for the quick reply. I have instigated that but now i dont seem to be able to get any data to insert..
Im not sure if i have fully understood the way in which to insert multiple data. I am using the Resource Viewer in chrome to check that data is there.. my code is:
var lookup = $.indexedDB('atlas').transaction(["Lookup", "BinRanges", "Company", "Region", "Agents", "Features", "Pickups"]).done(function(){
// transaction has completed, you are good to go.
console.log("Transaction Complete");
lBool = true;
}).progress(function(){
// transaction is in progress here, do the adding to DB
var lookupOS = $.indexedDB("atlas").objectStore("Lookup");
lookupOS.clear();
console.log(obj.Lookup);
$.each(obj.Lookup, function(){
lookupOS.add(this);
});
})
HI
Im looking for a bit of help.
I have a javascript login page which redirects a user on sucessful login.
I want to be able to add a load of data to my indexeddb for use around the site instead of firing of ajax requests all the time; however my login script redirects the user before all of the data is stored in the db. (there can be quite a lot of it.)
I am looping through a response object like so:
is there a way i can detect when the entirety of the above has completed?