Thursday, June 26, 2014

How to check HTML5 Web Storage Support in JavaScript?

[caption id="attachment_879" align="alignnone" width="372"]HTML5 Data Storage HTML5 Data Storage[/caption]

[sourcecode language="javascript"]
function supports_html5_storage() {
                try {
                    return 'sessionStorage' in window && window['sessionStorage'] !== null;
                } catch (e) {
                    return false;
                }
            }
            alert(supports_html5_storage());
[/sourcecode]

2 comments:

  1. Hi, I think your blog might be having browser compatibility issues.

    When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it has
    some overlapping. I just wanted to give you a quick
    heads up! Other then that, fantastic blog!

    ReplyDelete
  2. Hi, thanks for your feedback.
    IE is a shit browser, As a developer, I do not worry about that though it would really matters in browser compatibility point of view.

    ReplyDelete

How to enable CORS in Laravel 5

https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...