You can use change ajax this: request.getResponseHeader('your_header')
$.ajax({
type: 'POST',
url:'api-url.php',
data: formData,
success: function(data, textStatus, request){
alert(request.getResponseHeader('your_header'));
},
error: function (request, textStatus, errorThrown) {
alert(request.getResponseHeader('your_header'));
}
});
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?
- Is it safe to assume that a nonce may be validated more than once?
- Using Nonces for AJAX that only retrieves data
- store/cache ajax sent data to avoid repeated request
- How to implement AJAX post navigation into WordPress?
- wp_ajax_[service] returning 0
- Run again current query via ajax but changing a var
- Ajax function returns -1
- 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
- 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
- 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 check an ajax nonce in PHP
- admin-ajax.php slows down, but cant figure out which plugin
- Fatal error: Call to undefined function get_post() with ajax
- Convert this relative path to absolute
- Load WP content with ajax less server demanding and faster than normal page loading?
- how to send Ajax request in wordpress backend
- WP Admin AJAX Security – using POST to include a relative URL
- Admin-ajax.php 400 error
- problem with WordPress ajax
- Ajax simple experiment
- How to load new text widgets and polls into the sidebar without reloading the page?
- How to make tabulator ajax call in wordpress?
- Radio buttons live refresh in the customizer
- Admin ajax add tag callback
- Stop auto load wp-admin admin-ajax.php
- Save & Reset button in theme-option with Ajax (without refresh)
- Ajax Multi Response Problem
- AJAX call inside plugin class not triggering
- Force redirect single.php to index
- Any plugin or Script to integrate ajax selection module into WordPress page
- Custom AJAX Endpoint not returning any result
- Contact form 7 Hide response messages after 5 seconds
- WordPress Heartbeat API cannot parse data
- how should i get json encoded data from wordpress ajax action page
- Cache plugins and ajax nonce verification
- Ajax function on #publish only saves as draft – how to make it publish?
- AJAX call broken after actualization
- How to include php-generated javascript?
- Serve a different theme based on window size
- custom autocomplete search
- Ajax function not returning any results
- ajax problem – function on server is not called
- wp_mail doesn’t work when logged in?
- Need help with Access-Control-Allow-Origin
- Send email via ajax
- wp_ajax handler with multiple class instances
- admin-ajax.php (aborted) error when using jQuery.get
- Load page HTML content through AJAX
- problem using ajax url
- Problems implementing Load More functionality
- admin-ajax.php error 500
- How to display contact form 7 form in vanilla js without jquery in frontend
- Error sending array data from php to javascript
- Sharing variables in both actions wp_footer and wp_ajax
- Display full WordPress post under search form using AJAX
- Ajax callback not work
- WordPress Select Option Load Custom Fields
- jQuery.post returns 0
- Ajax login fails: script sets cookies, but is_user_logged_in() returns false
- do_action won’t work in ajax callback
- Opening Modal popup on Ajax form submission
- Ajax sometimes work and sometimes just don’t work
- admin-ajax error 400
- wordpress admin ajax trash_comment
- Its possible to ajax update the content of the admin custom post type list
- WordPress custom ajax login not working on mobile browsers
- Failed to load resource: the server responded with a status of 404 (Not Found) admin-ajax.php
- Javascript output now showing in custom widget
- Create a post with REST API and adding a category
- how to correctly use json_encode with ajax
- How to trigger lost password email using REST API?
- Display post thumbnail after clicking on post id with AJAX
- Using AJAX on Contact-form the WordPress way
- Retrieve Header Background Image with AJAX
- How to block search engines indexing certain AJAX actions
- AJAX call in backend results in empty update_option
- Ajax Comment: Page reloads whenever the comment submission form is reloaded
- wp_ajax_action, wp_ajax_nopriv_action not working
- get_comments() returns empty array if called through AJAX
- 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’
- How to get parent comment’s id?
- Static var overwritten with WP AJAX action, works fine without AJAX
- using ajax to query sql
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?