LocalStorage not working with HTML 5 Phone 8 project template
I am making a Windows 8 Phone app using HTML 5.
I am using localStorage to store small values as shown in the code below, I tested my code in all browsers and it worked fine, then I created a new HTML 5 project and added my code to the project and run the application.
In the following code, I suspect localStorage is not working here and I am wondering why ?? !
$("#cow_btn").click(function(){
localStorage.selected_category = "cow";
window.location.href = 'animals.html';
});
How did I come to this conclusion?
1 - I've tried giving warnings before and after localStorage.selected_category = "cow"; line, the first warning was shown here, but the second warning was not shown.
$("#cow_btn").click(function(){
alert("hello1");
localStorage.selected_category = "cow";
alert("hello1");
window.location.href = 'animals.html';
});
2 - Then I tried to remove the line and then my window.location.href = 'animals.html' which didn't work before now worked.
$("#cow_btn").click(function(){
window.location.href = 'animals.html';
});
What could be the problem? My whole application runs smoothly with Firefox, Chrome and even Internet Explorer 10.
Share your thoughts on this. How do I get localStorage to work with my HTML 5 Windows 8 Phone app?
Note:
I am using the following js - jquery.min.js and jquery.mobile-1.2.0.min.js
source to share