You need to pass the values to the localization script, “right” after this line:
wp_enqueue_script('rnm_load_more');
I’m going to pass the admin URL to your script by using wp_localize_script
:
$localization = array(
'ajax_url' => admin_url('admin-ajax.php'),
);
wp_localize_script( 'rnm_load_more', 'jjang', $localization );
Now, you can use the ajax_url
in your script:
var ajaxurl = rnm_load_more.ajax_url;
You can send the rest of the data by using this method.
Related Posts:
- Is there a JavaScript API? How to access public and private data in JS?
- jQuery Autocomplete not working with wp_localize_script
- Can’t seem to get wp_localize_script to work
- How to localize inline script called with ajax
- Nonces, AJAX, script variables & security in WordPress
- Ajaxing in functions.php
- how to send Ajax request in wordpress backend
- Populate a Map at The Same Time as showing Posts via AJAX
- wp_localize_script not working on ajax response
- How to make tabulator ajax call in wordpress?
- Why is wp_localize_script returning false?
- Ajax call with javascript in post content (not enqueued)
- How to add ajax url to js using wp_add_inline_script()?
- WordPress Ajax Filter
- Is there a better way to access transients using javascript
- How to load dynamic option with ajax
- Why the wp_localize_script() does not work correct in my case? ( /wp-admin/admin-ajax.php 400 (Bad Request) )
- Get localize of a loaded javascript
- How to Object.freeze wp_localize_script
- Ajax is not defined
- Ajax WordPress pass post URLs
- wp_localize_script not create variable in head section
- WordPress wp_localize_script nonce and ajax URL
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- JavaScript implementation of Gzip
- How to cache json with wp-super cache
- WordPress AJAX with Axios
- REST API endpoint for elasticpress autosuggest
- Admin Notification after save_post, when ajax saving in gutenberg
- Cannot load admin-ajax.php. No access-control allow origin*
- Initialize JS with an ajax loaded ACF form
- WordPress Nonce Issue for Ajax Login and Logout
- How to modify wp_ajax function?
- Nonces and Ajax request to REST API and verification
- Vue.js + AJAX Shortcode
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- wp_ajax action is not running
- WP_LOCALIZE_SCRIPT doesn’t work
- Ajax – gettext without a plugin
- How do I set the url to make an ajax request for a html document?
- wp-admin AJAX with Fetch API is done without user
- Ajax stops working when logged in?
- WordPress ajax get content post id
- Populating content dynamically via AJAX and Advanced Custom Fields [closed]
- Create Page With wp_insert_post() and AJAX
- Get wp_title wp ajax
- Ajax custom search not functioning as expected
- Jetpack Infinite Scroll – Add more than 7 posts each time?
- SSO autologin WordPress + Ajax
- Speed/Performance difference between `wp_ajax` and `init` checks for AJAX/POST requests?
- How to handle 400 status in Ajax [duplicate]
- Remove trailing 0 from function that is used both statically and dynamically
- How to update Comment post meta through an Ajax call
- Wp mail does not work when Ajaxed to
- Exposing data using a custom WordPress API
- Get response for check_ajax_referer
- Custom Login with Ajax not working with IE
- AJAX jQuery post frontend returning failed to load resource status 400
- 400 Bad Request when sending XHR from React.js to admin-ajax.php
- Making POST request with AJAX returns a 400 error (without jQuery)
- Front end theme options ajax returns 0
- Load image src through Ajax by ID?
- Using get_theme_mod in php ajax form doesn’t work
- PHP session when called wp_ajax_nopriv
- What exactly does ‘authenticated’ mean for wp_ajax_nopriv?
- Use AJAX in a WordPress Plugin to Get Data From Custom Database?
- Custom RPC end-point security best pratice?
- AJAX – SHORTINIT set to TRUE returns blank
- Ajax mousedown call getting “cancelled” when clicking link
- WordPress Ajax Not Firing
- Get uploaded attachment width & height and attachment ID after upload them
- Refresh checkout fields on add to cart with order bump
- Add Server Side validation in Ajax mail form
- Is it good practice to use REST API in wp-admin plugin page? [closed]
- Ajax not sending the data correctly- Multidimensional array
- get a bad request 400 on my ajax-admin.php file
- How to check Ajax request only when i opened the Notifications list?
- All WordPress AJAX calls always return 0
- How to send the checkbox value to email
- how to get password from user instead wp-generate-password
- Ajax Response Error | just getting error as the response
- Class called in template, AJAX not registering
- Same query in category.php and in function.php, but different result
- How to use nonces for frontend AJAX voting if the page gets cached?
- Ajax take too long to return code
- problem when adding wp_editor with ajax [duplicate]
- Get wp-load.php PATH with wp_localize_script and JavaScript for plugin
- Ajax request to admin-ajax.php and window.location.href
- Objects and get_post_meta() gives me 1 string for latitude and longitude
- where does my function output from load-* go?
- WordPress ajax requst returns zero
- wp_editor() in content that was loaded with ajax [duplicate]
- WordPress blocking polling request when signed into Admin
- Facebook Pixel + WooCommerce + AJAX = Confusion
- Send button using own contact form [closed]
- Translating wordpress foreach to ajax
- AJAX loading with custom parameters
- Adding custom fields to Wired Impact Volunteer Management Plugin
- randomly get 400 error while user is logged in wp_ajax