How do I "hijack" the ajax page requests for jquery mobile

How do I "hijack" the ajax page requests for jquery mobile

When you click on a link, an ajax request is sent.  Is there anyway to "hijack" it to lets say call a function if the request returns a 404 error, etc?

Thanks