I have the Ajax content working in a sub-site set up as sub-directory. When I change to domain mapping the Ajax stops working.
The following code is in my sub-site child theme header.php:
jQuery.ajax({
url:"<?php bloginfo('url')?>/wp-admin/admin-ajax.php",
type:'POST',
data:'action=my_special_action&main_postid=' + mainPostID,
dataType: 'html',
beforeSend: function() {
jQuery('#test').html('<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/ajax-loading.gif" alt="pagina is aan het laden..." />');
if(!mainPostID) {
$('#test').html('<p>Oops! There is no data...</p>');
return false;
}
},
success:function(result) {
// alert(result);
jQuery("#test").html(result);
}
});
It probably has something to do with the call to admin-ajax.php.
So I tried using the full domain of the main website, that did not work.
I also used the domain of the sub-website. That did not work.
Hope someone can point me into the right direction.