Ajax request to admin-ajax.php and window.location.href
In relation to this question, I don't understand the meaning of:
Instead of sending the ajax request to the admin-ajax.php, send it to the
same url (using js window.location.href ) but including an endpoind that
can be 'mobile' or 'desktop'. An hook into template_include filter will do
the rest. Hope it's clear
This is my call:
jQuery.ajax({
url: my_ajax_script.ajaxurl,
data: ({action : 'get_mobile_template'}),
success: function(data) {
document.write(data);
}
});
Is there anybody who understands this matter and is able to come up with
an example?
No comments:
Post a Comment