You second JS setting is more in the right direction, your biggest failure seems in misunderstanding how ajax requests are handled on the WP PHP/server side.
On the PHP side, an action is being triggered based on the action parameter in your AJAX request. Since this is a generic mechanism it doesn’t have any facilities to “guess” how many parameters are being passed or their order (probably something could have been developed to do that, but the current core code doesn’t do it). Therefor the best you can get is to trigger the call to the be_ajax_load_more
function when the request is received.
In the function itself you need to read from $_POST
the relevant fields to get the parameter. IIRC this should be something like $_POST['category']
which should give you the value 'tv'
Related Posts:
- Pass request headers in a jQuery AJAX GET call
- My javascript is returning this error: $.ajax is not a function
- TypeError: $.ajax(…) is not a function?
- XML Parsing Error: not well-formed in FireFox but good in Chrome
- Ajax Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- How to get a cross-origin resource sharing (CORS) post request working
- jQuery Form Validation before Ajax submit
- How to manage ajax calls and JSON in wordpress
- ajax stopped working when not logged in?
- Using jQuery to delete data stored in wp_options
- What is the simplest ajax upload plugin or script to be used with wordpress?
- WordPress Ajax URL for function in functions.php
- Ajax call does not activate callback function
- AJAX call returns 0
- AJAX function returning -1
- call shortcode in javascript
- jQuery and AJAX Not working with Select Form Element
- How to pass both action and formdata in wordpress ajax?
- jQuery AJAX form validation
- Proper way to load a single post via Ajax?
- Basic WordPress AJAX Call
- Trying to get single posts to load on the front page via ajax
- Bind to WPSetAsThumbnail
- Ajax not firing properly using Firefox, but works in Chrome
- jQuery Ajax() doesn’t work when the page is accessed as a WordPress template page
- How to load whole WordPress pages dynamically with AJAX/jQuery like this following website?
- Creating custom AJAX requests
- How to pass jQuery ajax URL value
- Cannot access elements of json object
- Basic ajax call in WordPress
- how to get the comment ID in the front end when the REPLY button is clicked?
- Admin wp_ajax hook returning 0
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- wp_verify_nonce not working
- Tags in WordPress 3.2
- php ajax problem – weird 301 responses!
- WordPress customizer refresh screen after save
- Is there a restriction in WP on the use of jQuery load function?
- Not sure why wp_ajax isn’t working?
- Load created php file data via ajax
- WordPress Ajax problem with undefined url
- Display data on same page as form without refresh
- Ajaxify calendar
- Error when posting comment form: The error is TypeError: e[h] is not a function
- Intergrating agile carousel to wordpress: how to write the ajax_callback function
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- Return an array from get_terms and store as JavaScript array for search autocomplete
- Frontend Post with JQuery AJAX to Php Issue
- WP http XML response HTML encoding and image display problems
- Passing a varible from jQuery to PHP
- videopress videos are not displayed when loading the content with ajax in a lightbox
- Add/remove action on jQuery toggle
- Retrieve post info within AJAX helper function
- delete post meta by AJAX
- url – ajax loaded but no JS
- Display posts from another site using REST API in an asynchronous manner
- Ajax form submit not working, returns 0
- Why does my jQuery AJAX return 0?
- Simplest ajax form not working when it should
- how to json_encode(); the Loop content so that the encoded array is [“0”:content, “1”:content]
- Loading dynamic content with AJAX breaking jQuery
- why is my wordpress Jquery-Ajax call not working?
- How to retrieve WP_Object that is inside an array of another array
- No Object Properties sending form through AJAX
- Can’t add classes using jQuery from a JSON string with get_body_class()
- Ajax call through admin-ajax.php returns 404 error
- click event to unhide something after ajax not firing
- WordPress Insert not working with ajax
- Search query with Ajax
- WP AJAX API with JS file
- how to use wp_editor() here am getting empty result
- admin ajax php success returns 0
- Why is ajax working on one server and not the next?
- Is there some jQuery conflict here?
- Getting jQuery AJAX to work in WordPress (getting -1)
- problems with jquery external rss feed integration
- Connect Agile Carousel to WordPress AJAX
- Which hook to use when adding ajax to viewer-facing side?
- my example with ajax doesn’t work
- jQuery forms & updating info
- Orderby post__in Not Working Correctly?
- Get ajaxForm response value
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Retrieve customizer value using ajax or customizer api and print the value in theme
- owl carousel not working after ajax load [duplicate]
- WordPress version for this autocomplete jQuery code
- Ajax Request with jQuery not happening
- jQuery AJAX add json2 dependency?
- How to pass more information though separate post keys via AJAX
- wp_signon not working fine and 302 moved temporarily?
- Loop not appending through infinite-scroll ajax call
- how to refresh index page without reloading browser using ajax
- Contact Form 7 submission does not complete [closed]
- Using WP Ajax and jQuery to process multiple forms on the same page?
- Combo box populating a DIV using ajax/jquery
- Infinite Scroll applied to ajax loaded content
- Load loop images on click / defer image loading until click or other event
- Widget won’t work due to old JavaScript? Any ideas how to make it work? [closed]
- Contact Form 7 – Submit Form not working After Ajax Request [closed]