IE9 prompts user on submission of hidden iFrame

前端 未结 1 887
太阳男子
太阳男子 2021-01-12 02:57

I am debugging our file uploading script, which uses a hidden iframe in browsers that do not support sending file data via an XMLHttpRequest object.

There is a ple

相关标签:
1条回答
  • 2021-01-12 03:27

    photo_upload.json IS being downloaded into the iframe, but because the browser doesn't know what to do with it, it assumes it to be a file for download.

    Ideally, you should have the iframe receive HTML data, which may contain a <script> to tell the parent window what to do. Alternatively, if you already have code in the parent to handle receiving the response (which it looks like you do), set Content-Type: text/html on the response to force the browser to treat it as an HTML document - it will automatically add the basics like an <html> tag and a <body> tag, so just access iframe.contentDocument.body.innerHTML.

    0 讨论(0)
提交回复
热议问题