jQuery.ajax({
url : postlove.ajax_url,
type : 'post',
data : {
action : 'post_love_add_love',
unit_id : unit,
user_counter : new_counter,
user : user,
},
success : function( response ) {
//jQuery('#love-count').html( response );
console.log(response);
}
});
This Works for me. Thanks
Related Posts:
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Is having multiple theme customizers for different pages possible?
- How to remove hardcoded characters from playlists?
- WordPress Ajax always returns a 404 error
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Data fetch and delete by ajax request
- Handling an Ajax form submit
- Use different javascript files for each page on website
- Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
- Click loads template via ajax
- Display notification only once
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- admin-ajax.php responding with 0
- How to speed up admin-ajax.php in wordpress
- Page Reloads Before AJAX Request Finishes
- Why is this Ajax not working?
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- How to make custom total price reactive in navigation
- How to prevent those PHP variables from being cached on WordPress?
- Ajax return code 400
- Trying to implement Ajax comments in WordPress, getting WP error
- How to test nonce with AJAX – Plugin development
- class click counter save number
- Trigger popup in a php if/else statement
- Ajax not working es expected (Returns 0)
- Load a page into a div with Ajax
- Creating a Multi-Level Associative Object Using AJAX
- Ajax – Call to undefined function get_option()
- Status 400 for AJAX POST Request with admin-ajax.php
- Ajax random number always the same
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Need Help Fixing My Iframes [closed]
- populate form fields in a loop with ajax
- How to send Ajax request from my plugin in admin dashboard?
- How to add a do_action on refreshing of WP customizer?
- How to pass Select value from Javascript to PHP to generate select option on change
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- AJAX success response is not working but it’s saving my changes
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Fancybox type popup window that’s not an iframe
- How to disable controls in theme customizer?
- WordPress Ajax Call inserting data but success response false
- admin-ajax Firing Error 400 When Logged In
- Making an AJAX call to refresh a table
- load ajax using admin-ajax.php
- Load Posts on Click via Ajax into a DIV
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Why i can’t get custom fields value or post ID via Ajax?
- Cannot access $wpdb, comes back NULL
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Incrementing PHP variable onclick to display posts by month
- Accessing an API with jQuery and AJAX
- Ajaxurl suddenly not defined
- security concerns if using html data-* attribute for l10n?
- How to use wp_send_json() and output the value with ajax?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- duplicate posts with ajax load more wordpress
- Settings API form – submit with AJAX
- How to extend SelectControl with data from my theme
- Post form – AJAX won’t upload featured image – Plugin development
- Load more posts using AJAX based on posts inside WP_Query
- How can i find wrong word in search box and replace with correct word
- How to change PHP variables with AJAX request in WordPress
- How to use wp_ajax_set_post_thumbnail?
- Submit remote form to wordpress REST API and save data to custom post type
- Update $wpdb query with AJAX
- $.ajax results in 403 forbidden
- register dependency css and js inside a plugin class
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- AJAX to add to cart multiple products woocommerce
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- Collapsible menu on post sidebar only expands and does not collapse
- wordpress dependent dropdownlist using post type is not working
- How to echo a PHP code into WooCommerce variation product?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- Custom theme admin-ajax.php 400 (Bad Request)
- ajax polling with admin-ajax.php
- Custom Post type Ajax search results
- number of posts with “Load More”
- Ajax wordpress function showing source code in alert and not value of input field?
- Woocommerce variable products are being added to the card on the homepage (ajax)
- How to load WP_Editor JS files manually (with AJAX)?
- Find the method which AJAX GET calls
- A javascript function that simply runs a php function on the plugin
- Retrieve $_POST data to send to javascript without using localize script
- 500 (Internal Server Error) of external php file
- Problems with plugin that fetches data from database with ajax
- Dynamic Gallery
- Execute PHP code in Javascript onclick
- Load php function with AJAX on modal window
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- Remove Woocommerce product from cart with ajax/fetch
- WooCommerce Modal Fly cart on add to cart – With AJAX
- How can I use AJAX in child theme template?