I am working on a project, i.e. a mobile web application. I am using jQuery mobile.
I have a jquery list page, when the user clicks on each element in the list, all data associated with this element is transferred to the dialog page. I used local storage to pass values ββbetween pages. However, what I'm trying to do is record the user action and display them as an activity feed. Storage of what element they clicked on, how much time they spent on an open dialog page and the ability to display all this information on a new page. example
You clicked on an item
You spent 15 seconds on point b
and etc.
So will local storage be good for this or or WEB SQL?
I also noticed that WeB SQL is no longer actively supported? http://www.w3.org/TR/webdatabase/ Does this mean it will be obsolete?
Local storage example:
each element is a json object, I need to pass the whole object to view it on a new page, so I:
function addPostToLocalStorage(YTfeeditems){ $(".item").on('click', function () { var i = $('.item').index(this); console.log(i); var Viditem = YTfeeditems[i]; console.log(Viditem); localStorage['youtubeclickedPost'] = JSON.stringify(Viditem); storedItem = localStorage['youtubeclickedPost']; retrievPostFromLocalStorage(); } }); function retrievPostFromLocalStorage(){ var retrievedStringItem = localStorage.getItem(['youtubeclickedPost']); var convertedPost = JSON.parse(retrievedStringItem); showDetailedPost(convertedPost); }
when an element is clicked, I would like to save the video ID, record the time it was clicked, record how long ytfullviewpage opened, and also within this page entry, if the image thumbs up was pressed or if thumbs down was pressed, add these data to the local ftorage file and find it on a new page to show it. Looks like I understand how to do this with local storage. I have embedded my javascript for this here
which can give you a better idea.
source share