Created
August 24, 2021 15:13
-
-
Save Sentinel-7/a04173d208b12a21a49ab17fdb5058c6 to your computer and use it in GitHub Desktop.
Добавляем url после отправки формы AjaxForm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('af_complete', function (event, response) { | |
$('#getAQuoteModal').modal('hide'); | |
if (response.success) { | |
$('#thanks').modal('show'); | |
let form = $(response.form[0]); | |
form.attr('action', '-%thks'); | |
let url = window.location.href; | |
if (url.match(/\?/)) { | |
url += '&'; | |
} else { | |
if (! url.match(/\/$/)) url += '/'; | |
}; | |
url += form.attr('action'); | |
history.pushState({}, '', url); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment