Hi I'm trying to store three fields in an IndexedDB. Its showing the names of each three indexes .. content, content2 and content3 in the browser. However, data is only being saved into content3 ?
Here is my source code:
<script type="text/javascript">
var request = indexedDB.open("synker");
var db;
request.onupgradeneeded = function() {
// The database did not previously exist, so create object stores and indexes.
db = request.result;
var store = db.createObjectStore("notes", {keyPath: "ID"});
store.createIndex("content","content", { unique: false });
store.createIndex("content2","content2", { unique: false });
store.createIndex("content3","content3", { unique: false });
};
request.onsuccess = function() {
db = request.result;
};
function addData(data) {
var tx = db.transaction("notes", "readwrite");
var store = tx.objectStore("notes");
store.put({content: data, ID:1});
store.put({content2: data, ID:1});
store.put({content3: data, ID:1});
}