P
Peter Michaux
I have a form which posts to a hidden iframe. The iframe is the form's
target. This is because the form must initiate a file download. So the
form is in the parent window and the iframe is the child.
There is potential that the server sends an error response to the
child window. I'm being asked to detect that error response from the
parent window so that the server-side programmers do not have to
change what they send as the response.
My suggestion was to change the server's response and have the server
send back a page with a snip of JavaScript to cause action in the
parent window. Something like "window.parent.location="/login/page"
for a session timeout. As far as I know, having the server send back
some JavaScript is the only standard way to have the parent document
take action based on an error loading in the iframe. This has been
judged too onerous a change to the server-side programming by the
server-side programmers.
So in case I don't know about something I could be using in this
situation, is there a standard, reliable way to detect that the iframe
has loaded its contents? If so I could then parse the iframe's
contents to detect an error.
Thanks,
Peter
target. This is because the form must initiate a file download. So the
form is in the parent window and the iframe is the child.
There is potential that the server sends an error response to the
child window. I'm being asked to detect that error response from the
parent window so that the server-side programmers do not have to
change what they send as the response.
My suggestion was to change the server's response and have the server
send back a page with a snip of JavaScript to cause action in the
parent window. Something like "window.parent.location="/login/page"
for a session timeout. As far as I know, having the server send back
some JavaScript is the only standard way to have the parent document
take action based on an error loading in the iframe. This has been
judged too onerous a change to the server-side programming by the
server-side programmers.
So in case I don't know about something I could be using in this
situation, is there a standard, reliable way to detect that the iframe
has loaded its contents? If so I could then parse the iframe's
contents to detect an error.
Thanks,
Peter