0

I'm getting to much time in get response of ajax call. Now i want to stop further process of ajax call if ajax taking time more then 30 sec time. Do any one know how can I implement it?

Thank you.

Rushil K. Pachchigar
  • 1,263
  • 2
  • 21
  • 40
  • Can you show us the ajax code you are using? Do you use a library like jQuery or vanilla javascript? – Jerodev Feb 21 '17 at 09:23

2 Answers2

1

You can take a look at the documentation for ajax: http://api.jquery.com/jQuery.ajax/.

Or this similar question: Set timeout for ajax (jQuery) with the answers provided.

Community
  • 1
  • 1
uzr
  • 1,210
  • 1
  • 13
  • 26
0
jQuery.ajax({
    url: 'ajaxhandler.php',
    success: function (result) {                               
       returned_value=result;
    },
    timeout: 10000,
    async: false
});
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
Michael
  • 405
  • 4
  • 10