jackmoore/colorbox — Issue #154: add an OnError event
Author: khalidabuhakmeh
Created: 2012-01-18 13:35:37+00:00
State: open

It would be nice if I could handle an error displaying colorbox when utilizing Ajax, currently the text slapped on the page is just not doing it for me.

$loadingBay.load(href, settings.data, function (data, status, xhr) {
prep(status === 'error' ? $div('Error').text('Request unsuccessful: ' + xhr.statusText) : $(this).contents());
});

might be something like:

$loadingBay.load(href, settings.data, function (data, status, xhr) {
prep(status === 'error' ? $(this).onError() : $(this).contents());
});