English 中文(简体)
Limit of localstorage on iPhone?
原标题:

I m wondering what s the limit of localstorage HTML 5 on iPhone? I read that it was like 5 Mb, but I m surprised is so little. Any ideas?

最佳回答

"The current default on iPhone is 5.0 MB. If your database grows beyond this limit, the user will automatically be asked to allow or deny the size increase. If he allows the increase, the database size limit will be upped to 10.MB"

Source: http://ofps.oreilly.com/titles/9780596805784/ch05_id35816678.html#ch05_id35933214

问题回答

Mobile Safari on the iPhone and iPad will hold 5MB before throwing a QUOTA_EXCEEDED_ERR when using localStorage. If you re using HTML5 SQL, the user will be prompted at 5MB intervals to increase the storage limit.

Desktop Safari v4 does not have a limit, afaik, on localStorage. However, Safari v5 limits the site to 5MB before throwing a QUOTA_EXCEEDED_ERR, exhibiting the same behavior as the mobile version.

There is a great way to tell the limit of your browser...

http://dev-test.nemikor.com/web-storage/support-test/

on January, 2021

Chrome and Safari over iPhone cant save more than 2750 Kbs in a localstorage var.

    //HTML

    <div> The localStorage limit is <span id="size">???</span> KBs. </div>

    //JS

    function gen(n) {
        return new Array((n * 1024) + 1).join( a )
    }
     
    //window.localStorage.clear();
     
    // Determine size of localStorage if it s not set
    if (!localStorage.getItem( size )) {
        var i = 0;
        try {
            // Test up to 10 MB
            for (i = 0; i <= 10000; i += 250) {
                localStorage.setItem( test , gen(i));
            }
        } catch (e) {
            localStorage.removeItem( test );
            localStorage.setItem( size , i ? i - 1 : 0);
            
        }
    }
    
    
    var el = document.getElementById( size );        
    el.innerHTML = localStorage.getItem( size );




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签