indexeddb

Why are my onsuccess/onerror callbacks not called when using indexedDB?

人盡茶涼 提交于 2019-12-12 00:46:18
问题 Im trying to create a login form. I have a few usernames (objects) in the db. I've created a form which takes the user name submitted (primary key) and checks if it's in the db. However after the information passes through my loginCheck() method the page just refreshes and doesn't run the success nor the failed alerts I set to debug JS: //-------------USER DB------------------// function startDB(){ //sign in page elements logUser = document.getElementById('logUserName'); logPass = document

Do I need to refresh a page to see if the Indexed DB was reset?

↘锁芯ラ 提交于 2019-12-11 18:14:35
问题 I started working with Indexed DB for HTML 5 but I am obtaining some strange results. The first one is that I try to clear my database but I only see that it was reset if I refresh the site. Is that how it should be? I have seen other sample codes which it does not happen in this way. The onsuccess is called but the DB shown, by the update method, is the same that was before... Here is my reset function: function resetDB() { try { if (localDatabase != null && localDatabase.db != null) { var

Why is my onupgradeneeded callback never called when connecting to indexedDB?

浪子不回头ぞ 提交于 2019-12-11 15:37:50
问题 I'm trying to get some data stored locally using IndexedDB. Below I'm I have a simple example with which I'm trying to get the onupgradeneeded event to fire <html> <head> <script> var indexedDB = window.indexedDB || window.webkitIndexedDB ||window.mozIndexedDB||window.msIndexedDB; var request = indexedDB.open("mydb",2), customerData=[ {ssn:"444-44-4444",name:"Bill",age:35,email:"bill@company.com"}, {ssn:"555-55-5555",name:"Donna",age:32,email:"donna@home.org"} ]; request.onerror = function

IndexedDB & localStorage Storage Limits

一世执手 提交于 2019-12-11 11:29:15
问题 From what I can understand Chrome imposes a "soft" limit of 5Mb on the size of data stored in localStorage and IndexedDB. There are a number of things here that are not clear to me What precisely is meant by "soft" in this context? Does this mean localStorage:5Mb + IndexedDB:5Mb? I have not hit the buffers yet but then I keep clearing out my browser stores as I develop my app. What happens when the limits are reached? An exception is thrown and needs to be caught? Would there be much mileage

Why do they use namespaces in javascript?

你说的曾经没有我的故事 提交于 2019-12-11 11:13:11
问题 I saw that they use namespace in some example of using indexeddb: http://www.html5rocks.com/en/tutorials/indexeddb/todo/ or http://greenido.wordpress.com/2011/06/24/how-to-use-indexdb-code-and-example/ Are there any real benefit of doing so? Is it just for organize the related object? 回答1: Simply (AFAIK), to prevent name collisions and polluting parent namespaces. 回答2: Demian hit the nail on the head in his answer: You namespace things to avoid name collisions and scope pollution. But they

Why does indexedDB objectStore.get call onsuccess even when the objectStore does not contain the object?

馋奶兔 提交于 2019-12-11 10:38:47
问题 One of the odd things about indexedDB is that a objectStore.get() request with a key that is not in the objectstore generates a success event with (event.target.results == undefined) (see: http://www.w3.org/TR/IndexedDB/#object-store the get function). I need to trap this type of "success" and log it. Right now, I cannot find the KEY in the returned event. So I am doing a real hack and storing it in the transaction. Any advice? var deferred = new jQuery.Deferred(); // this is what gets

Dexie.js Autoincrement Primary Key - does it ever reset? How to reset it?

南楼画角 提交于 2019-12-11 10:07:04
问题 In Dexie.js you can create a store with an auto-incrementing key let db = new Dexie("nav_api"); db.version(1).stores({ jobs: '++id, json' }); So to test, I created 14 objects in the db via db.jobs.put({json: '[]'}) , and all their keys came out as expected, started at 1 up to 14. Then deleted some of the later ones, db.jobs.where('id').above(6).delete() , and added another one to the db, and its index was 15. Is there any way to reset the index to 0? I was using it for ordering, and I'm not

Crosswalk storage limits

不问归期 提交于 2019-12-11 10:06:03
问题 What are the storage limits when using Crosswalk? Do the same rules as for Chrome apply, just in isolation of the app using Crosswalk? Or in the worst case shared global storage limits with the regular Chrome install? Also, will Crosswalk move any data to the SD card in case the core memory fills up, e.g. an app uses say 1GB of some web database? Been looking but really can't find any documentation. 回答1: Sharing my knowledge thoughts on the matter - CrossWalk (CW) is just a runtime which

Why does Internet Explorer 11 not detect indexedDB

吃可爱长大的小学妹 提交于 2019-12-11 09:43:38
问题 I am trying to implement a simple web-app using indexedDB, and use this snippet of code to detect browser compatibility: if(!window.indexedDB) { alert("Your browser does not support indexedDB."); } When run in Chrome it does not open an alert box(as expected), but when run in IE, the alert box pops up. I figured this was just a crappy version of Internet Explorer, so I checked. It was 11. I went to http://caniuse.com to see what version is supported, and IE 11 is supported. What is going

Querying on multiple keys (range on one of them) with indexedb or ydn

喜夏-厌秋 提交于 2019-12-11 08:23:33
问题 I have read, re-read and read again this document and countless of other sites, but for the life of me I am unable to figure out how to do the following. I simply have the following (ydn notation) { name:'index', keyPath:['int1','int2','int3'], unique:false, multiEntry:false } And want to run a query along the lines of int1=a and int2=b and int3>c and int3<d Which I believe should be simple enough and if it's not possible in ydn (or too hard) I am fine with a pure indexedDB solution as well