I have this php-jquery code
<?php
//a php code determines value of the variable $url
echo "<script>
$('#main').html('Loading...');
$('#main').load('".$url."');
</script>";
?>
But, when the path indicated in $url doesn't exist, the content of #main remains stuck to "Loading..." and it doesn't display a 404 error. How can I fix this?