html5 - session storage not working in IE -
i using following code test session storage of html 5.. working fine in browser except ie. ie version installed 10.
code :
<!doctype html> <html> <head> <script> function clickcounter() { if(typeof(storage)!=="undefined") { if (sessionstorage.clickcount) { sessionstorage.clickcount=number(sessionstorage.clickcount)+1; } else { sessionstorage.clickcount=1; } document.getelementbyid("result").innerhtml="you have clicked button " + sessionstorage.clickcount + " time(s) in session."; } else { document.getelementbyid("result").innerhtml="sorry, browser not support web storage..."; } } </script> </head> <body> <p><button onclick="clickcounter()" type="button">click me!</button></p> <div id="result"></div> <p>click button see counter increase.</p> <p>close browser tab (or window), , try again, , counter reset.</p> </body> </html>
what problem?
what found both local storage , session storage features of html5 that, both these features work in internet explorer when page rendered through http
, , not work when trying access these features on local filesystem, i.e. trying open sample webpage directly filesystem url of sorts, c:/users/mitaksh/desktop
, etc..
deploy application on application server
tomcat
,etc, , access it.. , can see both local , session storage in action then..