skip to Main Content

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';…

VIEW QUESTION

jQuery ajax response time

I'm using a simple Ajax get method on local machine that providing to empty function in my server-side laravel code, and observe from browser network that response is returned randomly in from 250-500ms. Can't get any similar problem (if it's…

VIEW QUESTION
Back To Top
Search