Q:

Can I check is a page present w/ jQuery

If I have a URL, can I check if the page is present or not with jQuery? For example if it returns 400 Error, I'll execute one command and if not 400, another command?
Would I use AJAX call for it? Or what's the best way to handle it?
Sorry, did not realise this was important. URL is not on the same domain...

A:

If the page you want to check is on the same server you can use the success and error callbacks in $.ajax() to determine if the page exists:
$.ajax('path/to/file.html', {
    error : function (jqXHR, textStatus, errorThrown) {
        alert('File Not Found');
    },
    success : function (data, textStatus, jqXHR) {
       alert('File Found');
    }
});

Docs: http://api.jquery.com/jquery.ajax/
And an excerpt from the docs regarding the error callback function:

Note: This handler is not called for cross-domain script and JSONP
  requests.

UPDATE
To do this with PHP:
<?php
if (fopen($_GET['url'], "r")) {
    echo "success";
} else {
    echo "error";
}
?>

And then in JS you can poll this PHP file:
$.get('path/to/script.php', { url : 'http://www.google.com/' }, function (response) {
    if (response == 'success') {
        alert("File Found");
    } else {
        alert("File Not Found");
    }
});

Here is a list of accepted protocols for the fopen() function in PHP: http://us.php.net/manual/en/wrappers.php

