<script type="text/javascript">
//Check whether the browser supports Session Storage, if yes, then store the data.
if (window.sessionStorage) {
sessionStorage.myName = "Session Storage";
}
</script>
<script type="text/javascript">
if(window.sessionStorage && sessionStorage.myName != null)
alert(sessionStorage.myName);
</script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form id="form1" >
<div>
<input type="button" value="Get Value" onclick="getSessionStorageValue();" />
</div>
</form>
<script type="text/javascript">
if (window.sessionStorage) {
sessionStorage.myName = "Session Storage";
}
function getSessionStorageValue() {
if(window.sessionStorage && sessionStorage.myName != null)
alert(sessionStorage.myName);
}
</script>
</body>
</html>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (6)
Author
Commented:Thanks for the feedback! I'll try to update the article pretty soon!
Commented:
http://www.moneytoolkit.com/2012/04/apple-ios-html5-localstorage-is-broken/
Author
Commented:Thanks for the update!
Author
Commented:I'm done updating the information suggested by the users!
Commented:
View More