How can I request an increase to the HTML5 localstorage size on iPad, like the FT web app does?

前端 未结 5 922
南笙
南笙 2020-11-29 22:43

If you open http://app.ft.com (the Financial Times mobile web app), you are prompted to add the app to your \"home\".

After doing this, when you open the app, you ar

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 23:01

    This database is part of Web SQL Database API, which is not part of HTML5. Use the following the set the size of your database

    function prepareDatabase(ready, error) {
        return openDatabase('documents', '1.0', 'Offline document storage', 50*1024*1024, function (db) {
            db.changeVersion('', '1.0', function (t) {
                t.executeSql('CREATE TABLE docids (id, name)');
            }, error);
        });
    }
    

    Introducing Web SQL Databases on HTML5 Doctor has a very quick tutorial on how all of this works.

提交回复
热议问题