i5ting / ichat

ichat : it's an im client like webchat
http://at35.com:8888
Apache License 2.0
6 stars 6 forks source link

发现一个很严重的问题,android不支持websql #39

Closed i5ting closed 9 years ago

i5ting commented 10 years ago

http://www.w3.org/TR/IndexedDB/

i5ting commented 10 years ago

http://www.cnblogs.com/dolphinX/p/3415761.html

i5ting commented 10 years ago

考虑使用 https://github.com/axemclion/IndexedDBShim

IndexedDB Polyfill Build Status A polyfill to enable IndexedDB using WebSql.

IndexedDB is not supported on all browsers. This IndexedDB polyfill exposes the IndexedDB API in unsupported browsers using WebSQL. This shim is basically an IndexedDB-WebSql adapter.

More details about the project at gh-pages

Using this polyfill, you can use a single offline storage API across browsers (Opera, Safari, Firefox, Chrome and IE10) and even mobile devices (Phonegap on iOS and Android).

i5ting commented 10 years ago

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills

i5ting commented 9 years ago

http://html5test.com/compare/feature/storage-localStorage/storage-sqlDatabase/storage-indexedDB.basic.html

i5ting commented 9 years ago

目前状态

i5ting commented 9 years ago
var collection = new Collection('message_test');

        collection.use_websql();

        var obj = {
            type :'type',
            mid :'mid',
            uid :'uid',
            uname :'uname',
            avatar :'avatar',
            sid :'sid',
            sname:'sname',
            timestamp :'timestamp',
            msg :'msg'
        }
        // ok
        collection.add(obj);
        // ok
        collection.save();
i5ting commented 9 years ago

see https://github.com/i5ting/Collection.js