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
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- 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
- Plugin allowing for artists, events and venues
- How to add pagination to wpbakery grid?
- Show Heirachy of categories in WP Download Monitor
- Why plugin ajax response is -1?
- WP_Query ordering numbers as letters
- WordPress Ajax Callback
- plugin ajax to external php file always return null
- Where (or when) should I register a new taxonomy?
- 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”?
- DROP TABLE with uninstall hook not working
- ‘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 load wp_editor via AJAX
- wordpress file upload with ajax when site is ajaxyfi
- AJAX search as you type? [duplicate]
- WordPress api call using wp-ajax returns error 400
- Retrieve custom post types by custom taxonomies with WP_Query
- how to insert data in wordpress table usnig jquery ajax
- Using wpdb without loading all plug-ins via wp-load.php
- Redirect to another page using contact form 7? [closed]
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Call plugin with php function
- How to get a list of bundled products using wp_query in woocommerce
- Is it safe to use admin-ajax.php in the frontend?
- WordPress Apply filter in plugin causes 500 internal error
- Meta query for comparing two dates
- Create WordPress posts from JSON array using plugin in admin
- Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin
- Proper way to handle admin-ajax calls
- Using custom php file for ajax url inside plugin
- Add user meta after a user has registered and logged In [closed]
- Ajax object not defined – JS file is in plugin folder
- WordPress subfolder installation AJAX Problem
- WordPress API functions not working at AJAX functions.php call
- Delete data from custom table when deleting a post
- Plugin for a static piece of text on homepage
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- Need to edit author permissions | custom taxonomy
- How do I reinit WordPress plugins dynamically using jS?
- Trouble with AJAX using GET
- Adding LOAD MORE on a page
- adding dynamic/multiple slug values in ‘option_none_value’
- Rewrite/Change custom taxonomy slug
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- How to add specific posts to specific pages in WordPress?
- Why is my custom taxonomy image not displaying?
- admin-ajax.php returning 0
- Update User Meta Via Ajax
- Compare Ajax Data Results
- ACF Query result in a new td (echo)
- Ajax Load More on Hierarchical Categories
- cURL do not mimic click
- Multiple Meta key in search
- wp_schedule_event function reference
- Get custom term link archive with prefix
- Creating new option (add_option) from AJAX – Settings API
- How can I use wp_ajax_response for front-end error reporting?
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- Not getting result using ajax on wordpress
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- AJAX doesn’t pass variables to the php function in the plugin
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- Second foreach loop breaking (Posts2Posts)
- Plugin constructor called multiple times
- Ger posts from similar tags and categories
- wp_query for more fields plugin
- How can I add the custom taxonomy categories to the posts and pages?
- Include subtitle display to slideshow
- How to list the categories by custom taxonomy created?
- Ajax Called in Plugin php file
- Ajax Load More stopped working (Plugin with repeater template, shows hidden Button)
- 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?