update_option in javascript
JavaScript $(window).scroll(function () { if ($(window).scrollTop() >= $(document).height() – $(window).height() – 10) { /***update options***/ $.ajax({ type: ‘POST’, url: ‘http://www.example.com/wp-admin/admin-ajax.php’, data: { action : ‘hit-bottom’, option : $option, // your option variable new_value : $new_value // your new value variable }, dataType: ‘json’ }).done(function( json ) { alert( “Ajax call succeeded, let’s see what the … Read more