What problem with my code, in the console shows this error:
home:85 Uncaught TypeError: $.ajax is not a function
at HTMLFormElement.<anonymous> (home:85)
at HTMLFormElement.dispatch (jquery-3.2.1.slim.min.js:3)
at HTMLFormElement.q.handle (jquery-3.2.1.slim.min.js:3)
Searching for found this in SoEn :
My javascript code
<script type="text/javascript">
$(function() {
$('#login-form').submit(function(e) {
e.preventDefault(), $('#btn-login').html('Autenticando...');
var username = $('#username').val();
if (/^[a-zA-Z0-9_ ]*$/.test(username)) {
$('.form-message').css('display', 'block'),
$('.message').html('Existem caracteres especiais no seu usuário. Se estiver usando <strong>"@"</strong>, remova-o!');
return false;
}
$.ajax({
type: 'POST',
data: $(this).serialize(),
success: function(s) {
alert('ok');
}
});
});
});
</script>