I don’t have enough reputation to comment. Try giving the datatype to the ajax call maybe this is due to json error.
Try adding datatype in your ajax as html for testing, then you can get into working path from these
$.ajax({
type: 'POST',
url: ajaxurl,
dataType: "html",
data:{"action":'InsertIntoDB',message:text},
success:function(msg){
alert(msg);
}
Also just try ajaxurl
in the url field instead of MyAjax.ajaxurl
even specifying datatype is not helping otherwise don’t mess up with the url. Try the above and let me know what response you get in firebug.
Related Posts:
- How can I pass a variable to wp_ajax action?
- How to pass JavaScript variable to PHP in wordpress widget?
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Errors while using ajax from external wordpress page
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How to use wp-ajax in wp-cron
- How to add pagination to wpbakery grid?
- WordPress Ajax Callback
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- WooCommerce get_price returning wrong price when used via ajax
- Shortcode button dosent work for all posts. Work for first post only
- How to put JQuery/Ajax inside shortcode?
- Using a custom plugin to capture input data via Ajax and PHP
- Ajax call returning 0
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- Using color picker in plugin, does input attribute order matter?
- Call plugin with php function
- Does having more than 30 Admin Ajax affects site performance (plugin)?
- wordpress add_action() issue in ajax call
- How to get specific string/value from an array? php [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Asynchronous request in wordpress
- Plugin not working locally, but works on server
- Passing PHP Variables to AJAX Loaded Pages
- Ajax call not working in wordpress through a plugin
- Send Array from JS to php file then insert it in wp database through a plugin
- can’t unzip file
- Strange admin-ajax / CSS / $_SESSION issue
- How do I reinit WordPress plugins dynamically using jS?
- How can I adjust my function so the page editor still loads in the backend?
- WP Ajax DB issues
- Calling PHP function with AJAX
- In a plugin, How to update a json file using ajax
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Use AJAX to fetch Current Post Thumbnail for WordPress when Uploaded throughMedia Uploader Frontend
- How to use Datatable with Ajax when creating plugin on WordPress?
- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- Ajax call to php function doesn’t work PHP code
- Compare Ajax Data Results
- Conditional Fields depending on checkboxes
- Help with customising love it plugin (use within foreach)
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- Creating new option (add_option) from AJAX – Settings API
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- AJAX doesn’t pass variables to the php function in the plugin
- How do I convince this button to do something when it is clicked?
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- Pulling Advanced Custom Fields from other pages
- Response from Php File to Ajax is not getting sent
- Help me with my first very basic plugin
- WordPress portfolio pagination on home page
- How do I call an action hook into wp_ajax hook callback function
- Disable email notification after change of password
- __(): What if I have to pass in a variable?
- Run WP-CLI using PHP
- PHP Deprecated: Non-static method should not be called statically
- Calling function from within functions.php returns unwanted value
- Check if a class exists within a method
- Admin-ajax.php is dying “0” without processing function
- How to remove an Ajax action
- force customers to add only single item to card per purchase EDD [closed]
- Write to / remove from default .htaccess file from plugin?
- Programatically download a plugin
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- How to Use Parameters with a Do_Action Function Within PHP Tags
- CSS from textarea in options page to frontend what to do
- How do I pass a post ID to the page URL?
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- add image crop function like in wp customizer
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- wordpress file upload with ajax when site is ajaxyfi
- Using wpdb without loading all plug-ins via wp-load.php
- Create a plugin from within WordPress
- How do I add $_SESSION[”] to my wordpress page?
- How can i add simple code in only in posts by function.php
- Using custom php file for ajax url inside plugin
- WordPress Stats Plugin: Display Post Views [closed]
- Pagination not working
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Can I disable xml-rpc by setting it to false?
- Push Contact form 7 variable to front end after submission
- Add a parameter at the end of the url and prettify
- Share my WordPress plugin for updating how?
- How can I change page content for good once a button is pressed?
- Google Maps for Woocommerce Checkout
- working code, not working – Plugin Dev
- Get and Update Most Meta Value as an array in HTML form
- Configuring default woo commerce login with modal popup
- register_activation_hook doesn’t fire at all
- How can I remove this sidebar from my Search Results page?
- How to tweak a plugin without preventing it from updating
- Place max_execution_time in plugin [closed]
- Option value not getting updated until page refresh in WordPress
- Fatal error: Uncaught Error: Call to a member function fetch_array() on bool
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class