You only need to set the text of your A tag using $a.text('abc')
in your jQuery part. I did similar with the class
in jQuery part of How to securely add an Ajax button to an admin page
jQuery('#content').on('click', 'a.rml_bttn', function(e) {
e.preventDefault();
var $a = jQuery(this);
var rml_post_id = $a.data( 'id' );
jQuery.ajax({
url : rml_obj.ajax_url,
type : 'post',
data : {
action : 'read_me_later',
security : rml_obj.check_nonce,
post_id : rml_post_id
},
success : function( response ) {
jQuery('.rml_contents').html(response);
$a.text('Changed');
}
});
//jQuery(this).hide();
});
});
Related Posts:
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- SSL breaks customizer: page isn’t returned from ajax
- Is it safe to assume that a nonce may be validated more than once?
- Using Nonces for AJAX that only retrieves data
- How to verify nonce from Bulk/Quick Edit in save_post?
- How to implement AJAX post navigation into WordPress?
- wp_ajax_[service] returning 0
- Ajax function returns -1
- Problems with creating sortable sections in customizer
- Quick Edit: Selected Custom Taxonomy Not Refreshing After Save
- Is it OK to use a system cron to trigger a function hooked into the AJAX API
- Filter WP user acf field by ajax
- Ajax Request not coming back to class
- wp_verify_nonce always returns false when logged in as admin
- fetching via fetch/ajax gutenberg block data from third party
- How to make ajax content indexable by search engines?
- Conditional action hooks
- AJAX requests broken due to HTTPS for wp-admin
- query vars in url work but not in ajax call
- Is it safe to use $_POST directly in my plugin instead of using admin-ajax.php to receive data from ajax?
- How to make get_theme_mod work with AJAX in the customizer preview
- How to declare a JS variable in an AJAX call
- is_page() conditional not working inside an AJAX function
- How to check an ajax nonce in PHP
- Fatal error: Call to undefined function get_post() with ajax
- how to send Ajax request in wordpress backend
- wp_create_nonce() in REST API makes user->ID zero
- ajax nonce verification failing
- Plugin: AJAX query external API to sync to tables
- admin-ajax.php ” Missing argument 2″ warning
- splitting the URL using jQuery
- How do I get reusable blocks via frontend REST API?
- Is there builtin way to use protected AJAX endpoint?
- AJAX Load more on CPT returning random posts
- WordPress admin-ajax.php not available for subscribers/contributors
- WP Ajax never returning any data / calling action
- Should I check for privileges before hooking into `wp_ajax_$handle` or after?
- Refresh Markercluster after ajax call
- How to load content from many posts on a page, only if needed
- Mapping Backbone Models to serialized array in wp_options table
- WordPress Settings api data not sanitized if i use ajax
- Ajax login without redirect/reload
- wp_mail 200 response but no mail sent
- Ajaxify Form That Submits To Same Page To Display Post Data [closed]
- Pagination Using ajax
- Ajax call with javascript in post content (not enqueued)
- What’s the latest I can hook into wp_ajax_%?
- Nonce doesn’t validate in nopriv call
- How to use ajax to get multiple outputs?
- Sql formatting for post data within function
- Get returned URL from wp_remote_post if response code is 302
- Change URL without reload Ajax
- Admin-ajax.php 400 error in custom theme
- Why does check_ajax_referer give a 403 error on https websites?
- WordPress is creating nonce as a logged in user but verifying it incorrectly
- Hide Load more Ajax button if there is no more users to load or less than the number?
- Send checkbox status with Ajax / JSON and save it
- How to get setting from separate file?
- wp_ajax action is not run when ajax trigger
- Contact form – ajax, wp_mail
- Replace link with form to pass variables to javascript / ajax
- WordPress function not defined in AJAX call
- admin-ajax.php calls fail if referrer is sent with 500
- Fetch value using AJAX in WordPress
- AJAX not working when clicking load more button, when two terms are present in tax_query
- AJAX – get_posts for a specific post type returns empty
- Admin Ajax always return 0
- Ajax call undefined index
- Is there a hook that fires after an ajax call?
- Dynamic Twitter card images
- How to pass value from ajax to php in no conflict mode?
- WPBakery post content inside Bootstrap Modal
- error_log() not working within wp_ajax_{action} handler
- Is there a way to add ajax hooks without editing the functions.php file?
- Implement AJAX to fetch pages or posts content in a WordPress custom theme
- Assign author on ajax wp post insert
- Ajax a php file that has Advanced Custom Fields in it
- AJAX is not submitting data to database
- delete post meta data in array WordPress
- How to trigger lost password email using REST API?
- Display post thumbnail after clicking on post id with AJAX
- How to block search engines indexing certain AJAX actions
- Error while submitting form using AJAX and php
- wp_ajax_action, wp_ajax_nopriv_action not working
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- Is it a good idea to init ajax functions only while ‘DOING_AJAX’
- register_setting and AJAX?
- ajax response is 0 instead of ‘script’ [duplicate]
- using ajax to query sql
- A refreshless WordPress website
- get_template_part() does not render after the ajax request
- How to get data with Select AJAX PHP
- Add “load more” functionality to an AJAX response
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- weird Internal Server Error – no error log produced
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?