Where my mistake in converting jquery ajax to pure js ajax request
That's my JQuery code which is currently working -> $("#newsLetter-form").on('submit',function(event){ event.preventDefault(); email = $('#emailId').val(); console.log(email); $.ajax({ url: '/subscribes/emailSubscribe', type:'POST', data:{ "_token": "{{ csrf_token() }}", email:email, }, success:function(response){ console.log(response); $('#responseFromSub').text("Registred!"); $('#responseFromSub').css('background','lightgreen') $('#newsLetter-form').css('display','none'); $('.sucsessMessage').fadeIn(1); setTimeout(function(){$('.sucsessMessage').fadeOut(1);$('#newsLetter-form').css('display','flex');},3000); }, error:function(response){ console.log(response); var val = 'asdasd:111122:123123123';…