Possible Duplicate:
jQuery $.get or $.post to catch page load error (eg. 404)
Maybe I am thinking this through wrong. But here goes anyway. Currently with the help of jQuery I am running $.post().
However I am posting to get contents based on a directory. Issue is the information is dynamically set. So if it turns out to be where I in a sense query for a file/folder and it doesn't exist I get a 404, 401, 500 whatever error.. Basicly in short telling me it doesn't exist. That said, how do I check for that, or catch it so when it occurs I can throw a custom error out via javascript through maybe a dialog or something.
Is it even possible? Mind you the ajax/post is not tied to a server side script currently and if it is to eventually be, it will be tied to a ruby on rails script.