I'm doing something similar to this code:
$('#myIFrame').attr('src', 'dosomethingthatreturnsadocument.aspx');
The page that gets called returns a document, whether that be a word doc, pdf etc and prompts the user to open/save and generally that is working fine.
The problem I have is if something goes wrong at the server side a 500 response is returned. I don't seem to have any way of catching the error.
I've tried a try catch around that line. The .error function of the iframe doesn't seem to catch it.
Does anyone know of a good way that would allow me to catch the 500 so I can act accordingly with the UI?