Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining .submit to .add doesn't work on IE #2069

Closed
DWAK-ATTK opened this issue Feb 7, 2015 · 2 comments
Closed

Chaining .submit to .add doesn't work on IE #2069

DWAK-ATTK opened this issue Feb 7, 2015 · 2 comments

Comments

@DWAK-ATTK
Copy link

The following syntax works on Safari (osx), Chrome (win/osx), and FireFox (win/osx) - but does NOT work on non-metro IE 11 (windows 8.1).

var html = '<form id="theForm" name="theForm" action="/controller/action" method="POST">;
html += '<input type="hidden" name="bob" value="-1" />';
html += '</form>';

//  I expect this to work in IE as it does in all other browsers.
$(document).add(html).submit();

// this also does not work in IE, but it does in all other browsers:
$('BODY').append(html).submit();


// This is the only thing I can get to work on IE - also works in other browsers.
$('BODY').append(html);
$('#theForm').submit();
@gibson042
Copy link
Member

I'm not sure what you're expecting code like $('BODY').append(html).submit() to do, and therefore I also don't know what you mean by "work". What I expect it to do is append a form to the body and then trigger a "submit" event on the body. Whereas something like $(html).appendTo('BODY').submit() would append and immediately submit a form.

@DWAK-ATTK
Copy link
Author

Ah. I was expecting the submit to be triggered on the newly added html.

Apparently my understanding was incorrect. Thank you.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants