Skip to content

Instantly share code, notes, and snippets.

@defrex
defrex / jquery.500frame.js
Created April 11, 2011 19:06
pop-up any 500s in an iframe using jQuery. Especially useful for Django errors.
$(document).bind('ajaxError', function(e, jqXHR){
if (jqXHR.status == 500){
var erframe = document.createElement('iframe');
$('body').append(erframe);
$(erframe).css({
'position': 'absolute',
'top': '5%', 'left': '50%',
'width': '90%', 'height': '90%',
'marginLeft': '-45%'
}).attr('id', 'errorframe');