supports_html5_storage()

    function supports_html5_storage() {
        try {
            return 'localStorage' in window && window['localStorage'] !== null;
        } catch (e) {
            return false;
        }
    }
Example:
if(supports_html5_storage()) {
 // do whatever
}

Description

Function to determine if the browser supports HTML 5 local storage.

Details

Double click on the code to select all.

 

;