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},标明哪一个是主键,是否自增长