Answer the question
In order to leave comments, you need to log in
How to connect SweetAlert to an existing JS script?
welovepavel.esy.es/techno/index.html
$(document).ready(function() {
$("#form").submit(function() {
$.ajax({
type: "POST",
url: "mail.php",
data: $(this).serialize()
}).done(function() {
$(this).find("input").val("");
<b>СЮДА</b> swal("Good job!", "You clicked the button!", "success");
$("#form").trigger("reset");
});
return false;
});
});
<script src="common.js"></script>
Answer the question
In order to leave comments, you need to log in
1. You have a typo in the line <script scr="jsB/sweetalert.min.js"></script>
2. There is an extra line in the welovepavel.esy.es/techno/common.js<script src="common.js"></script>
file
Otherwise, I don’t see any problems
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question