I have jQuery code that will check when the user is at the bottom of the page. This is not a problem though. This jQuery submits an AJAX request, providing some details on what to load when the user is at the bottom of the page. At the moment, the code looks something like this:
$("<div>").load('?ajax=y&offset=something', function() {
$(".empty-div").append($(this));
setTimeout(function(){ console.log('after', $(document).height()); }, 0);
setTimeout(function(){ console.log('after', $(window).height()); }, 0);
});
My main problem is that I do not know what to request or how to send information to a PHP function in functions.php. For example, at the moment I am using the PHP function (while it does not work):
function get_posts_page() {
if(isset($_GET['offset'])) {
echo"Hello!";
}
}
, wordpress add_action , , , PHP , Javascript. URL, -? . , Javascript PHP functions.php, ?