I am trying to get post a form to a hidden, dynamically inserted iframe, but in Internet Explorer the form submission opens in a new window.
var iframe = document.createElement('iframe');
iframe.name = 'hidden_iframe';
iframe.className = 'NotVisible';
iframe.id = 'hidden_iframe';
document.body.appendChild(iframe);
var my_form = document.getElementById('my_form');
my_form.target = 'hidden_iframe';
This works in Firefox but not Internet Explorer.
Apparently you need to include the name in the call to createElement. This works in IE and causes an exception in standards compliant browsers. We get: