Try adding return false; to prevent the default submit action of the click.
$('.grp_getnew').on('click', function(){
var data = {
action: 'get_random_post_tu',
usecategory: $('#categoryselect').val()
};
$.post( ajax_object.ajax_url, data, function(response) {
if ( response.status != 'error' ) {
var $link = $("<a href="" + response.link + "">" + response.title + "</a><span >" + response.content +"</span>");
$('.grp_content').html($link);
}
}, "json");
return false;
});
Related Posts:
- Query Posts by Custom Field ‘Price’
- Why get_posts() not returning only selected category posts from Custom Post Type?
- AJAX search posts and pages
- Using AJAX to generate front end / viewer end pages
- woocommerce search by sku and title ajax
- Only return taxonomies that are linked to a category & product
- User Following System
- Help with 4.6. Attachment response object in JSON API plugin
- Custom Taxonomy in plugin and template
- Loading shortcode with ajax
- Add .html extension to custom post type taxonomies
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Why is my ajax call refreshing the page?
- How to count number of records found in a database table?
- Custom Post Type causes Page Not Found
- Admin-ajax.php is dying “0” without processing function
- Advanced Custom Fields query
- How to remove an Ajax action
- Can I run multiple queries with $wpdb->prepare?
- Get Plugin Information from Multiple Sites Externally
- How to add pagination to wpbakery grid?
- custom taxonomy and custom post type url conflict
- Show Heirachy of categories in WP Download Monitor
- Why plugin ajax response is -1?
- Add custom taxonomy to title tag [closed]
- WordPress Ajax Callback
- plugin ajax to external php file always return null
- WooCommerce shop page orderby [closed]
- Limit Number of Taxonomy Terms (Images) Displayed
- Widget for adding HTML markup to a page
- When to use action hooks and plugins
- Form isn’t inserting data into database with ajax plugin
- How do I “get the next 10 posts after post_id == x”?
- ‘No Results Found’ on single post for custom post type
- jquery not calling php function
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- How to handle cookies from a WordPress plugin on a cached page?
- Post Comments with Ajax in WordPress
- Render Modula Plugin Shortcode On Ajax Request
- AJAX Load more start with x posts
- Error in pdf generating plugin using FPDF
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- How to do the simplest possible frontend ajax call from a plugin?
- Asynchronous request in wordpress
- Remove value from array within post meta ajax admin
- How do I localize admin-ajax.php that is used in Ajax Load More – Infinite Scroll?
- Convert to shortcode?
- Is there a better way of handling AJAX requests in WordPress?
- Call Ajax URL in Plugin
- Loading by Ajax a plugin that also uses Ajax
- How to find the WordPress Nextgen galleries which are not used in WordPress posts?
- How to call php file in theme directory from plugin
- Rename existing cpt and taxonomy with new textdomain
- Get product categories and add them to a custom taxonomy
- Use get_pages() before another plugin modifies it
- How can I adjust my function so the page editor still loads in the backend?
- What database state changes happen after a post is manually “updated” with no changes?
- Display posts by alphabetical order
- Error datatable whit ajax
- Facing Problem with admin-ajax.php URL – Getting 404 with AJAX call
- WP Ajax DB issues
- Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /../plugins/rm-payment.php
- jQuery Ajax not loading page with ACF fields
- Cannot view Custom Post Type no matter what I try
- How achive serving multiple concurrent Ajax / Rest calls in plugin?
- How to use information from the database in the front-end?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Overwriting Plugin’s Ajax callback function from theme
- Get only selected custom taxonomy
- WordPress update plugin through Dashboard/Plugins displaying error
- History of page, interval of years
- Plugin does not create a custom table upon activation
- “Tree view” for wp_dropdown_categories() markup
- Show similar category portfolio items?
- display user input using ajax in wordpress
- Ajax, jQuery and WordPress
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- Contact Form loaded with Ajax
- How to load a plugin when doing an Ajax call? [duplicate]
- WordPress filter function using query modifications
- WordPress plugin ajax post parameter
- admin panel save option with ajax
- Insert data in custom table during new post creation
- Capturing POST data
- Award points if a specific custom taxonomy is selected – Cubepoints
- Pulling Advanced Custom Fields from other pages
- Checking url from plugin [duplicate]
- Response from Php File to Ajax is not getting sent
- Plugin Admin Page Ajax-Admin call returning 0, URL set correctly. Implemented localized scripts but did not fix it
- ACF Taxonomy Object term Null [closed]
- How to make a rest style plugin?
- WordPress portfolio pagination on home page
- wordpress Ajax success doesn’t return the value
- How do I call an action hook into wp_ajax hook callback function
- I want to display data last 7 days with date wise in chartjs?
- Failed to update a post when I add a taxonomy to it
- What is the easiest way to create a custom field archive?
- WP_Query does not return the result even if the data is present in the database
- Show the author only own types of publications. (JetEngine, Elementor)