Instead of url: ajaxurl + "?action=fdiAddFavorite",
, use two lines like this:
url: ajaxurl,
action: "fdiAddFavorite",
Then at the end of fdiAddFavorite()
, you try something like this:
echo $favorite_list; // could also send message like "success!"
wp_die();
Related Posts:
- ajaxurl not defined on front end
- Using Ajax call in jQuery doesn’t work in widget
- Admin-ajax.php appending a status code to ajax response
- Ajax in WordPress – path issue
- Ensure function has completed before allowing another Ajax call
- how to search users by ajax live search
- jquery & ajax sending data to php
- Ajax submit result opens in admin-ajax.php
- insert query on a custom table using ajax with jQuery plugin Jeditable
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- WP ajax requests not stacking?
- ajax working when function is on child theme but not in plugin page
- Ajax +wordpress onClick link redirect to new page and create html content
- Get cat parameter from admin-ajax
- Ajax on the Administration Side of plugin – returns 0
- Jquery php request is returning a weird result
- WordPress Ajax not returning Response
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- Ajax call not working with
- Page reload occurs before request finishes
- how to get context information inside my funcion
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- jQuery in WordPress Plugin
- AJAX form post returns 0
- Update Data parameter of a wp_localize_script() call
- WP Plugin Running before jQuery
- wp_localize_script is not adding a global variable for javascript
- How to build a fool proof AdSense revenue sharing model?
- How to pull user/author profile data in a plugin?
- should i be checking for jquery before enqueing it in a plugin
- Can’t get AJAX call working in custom plugin
- Bad Request in AJAX
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- 400 Bad Request, in wordpress theme development, wp_ajax
- jQuery instantly executes (a button click and css change) on load
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- How to include jQuery into my plugin so I can use it on plugin page?
- ajax recursive calls on wordpress returning answers outsite the function scope
- Are there any security risks when submitting data-attribute data through AJAX?
- how to get the post id in plugin
- Jquery was not found on this server
- How to enqueue scripts in right way in a plugin?
- How to get error object returned by wp_create_user
- Plugin AJAX Save to Custom Table
- making a plugin that moves other plugins wp_head actions to wp_footer
- Associate multiple email addresses with the same user account, so they can log in with either
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- Need help about understand api, wp, $ syntax in WordPress plugin script
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- Change/Set Page Title and Meta Tags from Page Called within a Plugin
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- Update a user profile via frontend
- Insert Into Post Not Working For Audio File Using jQuery
- How to disable a jQuery plugin on WordPress plugin page
- jquery in wordpress plugin with depdendency
- AJAX button with success callback. (Titan Framework)
- AJAX call to admin-ajax.php by subscriber returns home page
- Using function from enqueued .js file in theme in plugin?
- jQuery UI tab does not work in the plugin page
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- Ajax function is not working on WordPress
- How to overwrite iris color pallates from theme to plugin
- About a programming language starts with [closed]
- Best practice for plugin: always detect admin-ajax call?
- add_action wp_ajax_ not loading in plugin file WP Network
- Why is the form not updating when I select a new sector from the list?
- Workflow for new importer plugin – your advices?
- Plugin Form Submitting to admin-ajax.php instead of admin-post.php
- Use options to control jQuery plugin
- Execute Jquery when a specific page in my plugin is loading
- Thickbox in Plugin settings page?
- How to localize data array in plugin’s option page
- sanitizing/escaping plugin options
- Load php file with jquery in single.php
- How to relate the Category to user?
- AJAX request not routing through proxy
- Loading Images from Javascript on the Front End
- Ajax request sends url rather than data
- Using jQuery prepend() with file include
- How to deal with different jQuery versions?
- Ajax Favorite from foreach (how to specify which result result is processed)
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- wc_get_template_part doesnt display the content [duplicate]
- How to do admin ajax request in a plugin for rest api
- Catching a GET parameter from the URL and save it in the user meta when a user registers
- wp.media gallery collection sometimes undefined
- Ajax action has 200 status but response of No response data available for this request
- escape html in jQuery for WordPress
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- Query String Filtering API
- Posts form with AJAX request – Plugin development
- GET request return value as error instead of success
- How to control ajax calls without effecting memory of server?
- Bad request 400 using class based files