I'm tryin to send data from a ReactJS form to PHP:
handleSubmit(event){
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
$.ajax({
type: 'post',
url: 'Register.php',
data: $('form').serialize(),
success: function () {
alert('form was submitted');
}
});
});
});
}
I got this error message
'$' is not defined
<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>