Geolocation based List Sorting
jQuery Mobile & HTML5 Local Storage
While experimenting with jquery mobile and local storage the other day i came up with a very simple to do list app. All the tasks are saved in local storage and will remain there until they are deleted by the user.
View Demo (best experience on mobile device)
Getting Checkbox Value Jquery Mobile
How to use local storage to retain checkbox states for filtering items
var checkBox_html; $.each(localStorage, function(key, value) { //key, value console.log(key + ': ' + value); var obj = JSON.parse(localStorage.getItem(key)); var checkBox_add_html = (obj.checked == 'checked') ? 'checked="checked"' : "" ; checkBox_html = ''; checkBox_html +=''; $(checkBox_html).appendTo("fieldset"); $("#first").trigger("create"); }); //change input events $( "input" ).change(function() { isChecked = $(this).prop( "checked" )?'checked':'not'; localStorage.setItem(this.id, JSON.stringify({ name: $(this).prop( "name" ), checked: isChecked })); }).change();
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。