I
I
IgorPlays2022-01-31 11:11:04
AJAX
IgorPlays, 2022-01-31 11:11:04

How to send an ajax request without waiting for a response?

I have an API request via ajax

datas = {
  domen: 'xxxx',
  username: 'xxxx',
  password: 'xxxx',
  api: 'xxxxx',
}

$.ajax({
  url: 'xxxxx',
  type: 'POST',
  dataType: 'JSON',
  async: false,
  data: {
    result: JSON.stringify(datas)
  },
  success: function(response) {
    console.log(response);
  }
});

But when I make a request, I wait a very long time for a response from Ajax, you can remove the wait for a response. It slows down the system a lot.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2022-01-31
@IgorPlays

take awayasync: false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question