sessionStorage in Firefox
Asked Answered
W

1

5

in firefox 9, when i do:

var msg = sessionStorage.getItem("message");

The browser ask with the error: "Operation is not supported", firefox not implement the webStorage of html5? or this case is only for sessionStorage and not for localStorage?. Thx.

Windbag answered 19/1, 2012 at 10:21 Comment(0)
W
9

Session storage is only available when you are serving your page from a server - you'll find that it doesn't work if you open the HTML page locally because there is no session.

In the case of browsers that may not support session storage, you can test for the feature:

if (window.sessionStorage) {
    ...
Wistful answered 8/6, 2012 at 15:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.