This example works in Firefox 4+ and Chrome. Note that Firefox does not allow local files to access indexedDB
, so you'll need to run this example through a web server to get it to work on Firefox (Chrome does not have this restriction).
方法:createObjectStore需要兩個參數,第一個是對象倉庫的名稱,第二個是一個js對象,例如{keyPath: 'userId', autoIncrement: false},標明哪一個是主鍵,是否自增長