views:

31

answers:

1

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();
}
+4  A: 

Try document.body.appendChild(container) instead.

KennyTM
Woow, that totally worked! Thank you very much, I've been trying to find out this for hours.
sekmet64