dimanche 4 octobre 2015

My AJAX requests take 30 seconds to complete

I am a wordpress newbie messing around with an installation on localhost using XAMPP and I've encountered a weird problem that I can't find any information on. The problem is that every time I try to make an AJAX request it takes exactly 30 seconds before it completes and executes the callback function.

What I'm doing is embedding a jQuery AJAX request directly into a page in the page section using the editor in "text" mode. There I insert some regular HTML and then something like this:

<script src="http://ift.tt/1HheyD3"></script>
<script>
alert("Before AJAX");
$.get("[insert_php] echo get_template_directory_uri();[/insert_php]/my_php/test.php", function(responseText) {
    alert("Inside");
});
alert("After AJAX");
</script>

When go to the page the two alerts outside pop up instantly and the one inside pops up after 30 seconds. I used Firebug to confirm that it's always 30 seconds until it completes.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire