admin管理员组文章数量:1287832
I copied a part of a bigger project i'm working on, I didn't wrote the code so I hope someone could help me find out why sending a post request from js code with this fashion works in IE and doesn't in other browsers.
function f() {
var container = document.createElement("form");
container.method = "post";
container.action= "http://localhost:3203/somefile.aspx";
document.appendChild(container);
container.submit();
}
I copied a part of a bigger project i'm working on, I didn't wrote the code so I hope someone could help me find out why sending a post request from js code with this fashion works in IE and doesn't in other browsers.
function f() {
var container = document.createElement("form");
container.method = "post";
container.action= "http://localhost:3203/somefile.aspx";
document.appendChild(container);
container.submit();
}
Share
Improve this question
asked Jul 27, 2010 at 13:15
sekmet64sekmet64
1,6654 gold badges20 silver badges30 bronze badges
0
1 Answer
Reset to default 16Try document.body.appendChild(container)
instead.
本文标签: javascriptWhy can39t I submit a dynamically created form in FirefoxStack Overflow
版权声明:本文标题:javascript - Why can't I submit a dynamically created form in Firefox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741263001a2367968.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论