Calendar month navigation in Ajax only working once

Your event target (#calender_section a) is replaced after refreshing the calendar. Because of the replacing, the event listener isn’t applied to the target anymore. You have to apply the event listener to a parent element which doesn’t get replaced (here it is #calendrier_wrapper) and use the selector parameter of on (see http://api.jquery.com/on/): $(“#calendrier_wrapper”).on(‘click’, ‘#calender_section a’, … Read more

Change button text after ajax db update

You only need to set the text of your A tag using $a.text(‘abc’) in your jQuery part. I did similar with the class in jQuery part of How to securely add an Ajax button to an admin page jQuery(‘#content’).on(‘click’, ‘a.rml_bttn’, function(e) { e.preventDefault(); var $a = jQuery(this); var rml_post_id = $a.data( ‘id’ ); jQuery.ajax({ url … Read more

get_body_class() in ajax envrionment

You are probably trying to do something wrong. Templating functions require context with global query and post variables properly set, and even then you might miss all kinds of filters because ajax requests are not being run in the context of template evaluation which means that template_redirect, wp_head and others are not being “run” which … Read more

Ajax Filtering Pagination

I’d do it like this: (see the // comment here in the code) // Wrap the AJAX call to `test_function` in a `function`. function ajaxTestFunction( page_num ) { if (jQuery(‘#telegram_chk’).is(“:checked”)) var telegram=””; else var telegram=”facebook”; if (jQuery(‘#twitter_chk’).is(“:checked”)) var twitter=””; else var twitter=”twitter”; if (jQuery(‘#eth_chk’).is(“:checked”)) var eth=””; else var eth=”ethereum”; if (jQuery(‘#xml_chk’).is(“:checked”)) var xml=””; else var … Read more

How to force the admin-ajax.php file to load over HTTPS?

If you are using Domain Mapping plugin doing this will quickly achieve exactly what you are asking for. Go to: YOURDOMAIN/wp-admin/tools.php?page=domainmapping Under: Excluded pages, check: Force SSL for all pages. Save and you’re done. Your insecure mixed content error due to admin-ajax.php loading via http instead of via https should be gone after this.