I'm having difficulty with the jQuery ajax success handler. Any javascript run-time errors that occur in the success handler dont seem to be getting reported (no errors appear in the Firefox error console). And trying to debug without error notification is driving me crazy. Could someone take a look at the simplified version of my code below and let me know if I'm doing something stupid that might be causing the problem.
If not, if someone could test this in Firefox and confirm (or not) that no error messages appear and its not just me going mad (or there is something wrong with my Firefox installation or something). I've also put the code on the web - so you can just click below to test it ....
http://www.alisonstrachan.co.uk/tests/ajax2/ajax_test2.html
ajax_test2.html
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//alert(missingVariable1); //uncomment -> get error reported (as expected)
$.ajax({
url: "ajax_test2_process.php",
data: {send: "hello"},
async: false,
success: function(data){
$("#results").append(data);
alert(missingVariable2); //no error reported (there should be surely?)
$("#results").append(" finished ");
}
});
});
</script>
</head>
<body>
<div id="results"></div>
</body>
</html>
ajax_test2_process.php
<?php
echo "received: " . $_REQUEST['send'];
?>
received:hello
isn't it the intended result