$("#contentid").load("index.php?r=ControllerID/ActionID",
function (response, status, xhr){
if (status == "error") {
var msg = "Sorry but there was an error: ";
alert(msg + xhr.status + " " + xhr.statusText);
}
}