For some reason, jQuery isn't loading my php file. The button is clicked and the page just refreshes. I have verified jQuery is working and the click function is working as well. Once it gets to $.post it doesn't seem to call that file and go through the pause and echo the result. The directory is correct for the php file. I am at a loss. Any ideas?
// HTML Code
<input id="doit" class="medium blue button" type="submit" name="doit" value="Sign in">
//jQuery code:
$('#doit').click(function(){
$('#fullscreen').show();
$.post('./delete-misc/test-ajax-code.php', function(data){
$('#fullscreen').hide();
alert(data);
})
});
// Php code (test-ajax-code.php)
<?php
sleep(10);
echo "Done";
?>
$.post('/delete-misc/test-ajax-code.php', ...without a dot in the beginning.alert(data). Try to addreturn false;before the});to prevent the form submitting.