I am having some trouble communicating with a PHP file via AJAX. When I execute the on click event below I expect it to give me an alert of "hello world" from the PHP file. Instead it only gives me the alert of "yep" from the AJAX success. Here is my AJAX call:
jQuery(".clickme").click(function (){
//start ajax call
jQuery(function test(){
jQuery.ajax ({
type: 'POST',
url: "test.php",
success: function(data) {
alert("yep");
}
});
});
//end ajax call
});
and in my test.php file there is just
<?php
echo '<script language="javascript">';
echo 'alert("Hello world!")';
echo '</script>';
?>
I have no idea why its not echoing my alert