开发者

Why can't I submit a dynamically created form in Firefox

开发者 https://www.devze.com 2023-01-08 20:45 出处:网络
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\'

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 bro开发者_开发技巧wsers.

function f() {
    var container = document.createElement("form");
    container.method = "post";
    container.action= "http://localhost:3203/somefile.aspx";
    document.appendChild(container);
    container.submit();
}


Try document.body.appendChild(container) instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消