LeXXXa
LeXXXa

Reputation: 71

IE11 doesn't use form target iframe

We're using form and a hidden iframe to upload files and keep user on the same page. It seems that recent IE11 update broke form target behavior: it no longer uses target iframe, but rather tries to display response directly. It worked correctly in IE9 and 10 as far as I recall, other browsers have no problem too.

Environment: Win7 x64, IE version 11.0.9600

Example:

<!DOCTYPE html>
<html>
<body>
    <form method="post" target="post-iframe" action="/iframe-post">
        <button type="submit">Submit</button>
    </form>
    <iframe name="post-iframe" id="post-iframe"></iframe>
</body>
</html>

Post handler returns JSON with appropriate Content-type.

Upvotes: 0

Views: 1284

Answers (1)

Adrian
Adrian

Reputation: 11

IE seems to have this problem if the response is a type other than text/plain or text/html. Try modifying the service that is returning application/json with JSON object to return text/plain content type with a JSON string instead.

Upvotes: 1

Related Questions