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

trigger('submit') и submit() работают по разному #23

Open
shastox opened this issue Apr 12, 2019 · 0 comments
Open

trigger('submit') и submit() работают по разному #23

shastox opened this issue Apr 12, 2019 · 0 comments

Comments

@shastox
Copy link

shastox commented Apr 12, 2019

Допустим у нас есть форма, которая отправляется по AJAX при submit:

<form id="form" action="..." method="POST" class="form-ajax-submit">
    ...
</form>

Две строке, которые означают одно и тоже, согласно документации, делают разные действия:

$('#form').trigger('submit'); - отправляет форму по AJAX - все ок
$('#form').submit(); - отправляет форму с обновлением страницы, не по AJAX, в консоли ошибок нет.

Если это не ожидаемое поведение, то могу сделать минимальный пример

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant