Jquery ajax, when periodicaly called, doesnt work on IE8

前端 未结 3 1907
情深已故
情深已故 2021-01-13 01:31

I am currently doing the same ajax request using jQuery every 2sec. For some reason, on IE8 it only work the first time. Each following request automatically seems to go to

3条回答
  •  时光说笑
    2021-01-13 02:35

    I have just encountered the same thing and have fixed it by setting the "cache" property of your ajax function call to false.

            $.ajax({
                url: "/ws/inventory/checkavailability/",
                async: false,
                dataType: 'json',
                cache:false,
                success: function (data) {
                    //so something interesting
                }, error: function (error) {
                    //display error?
                }
            });
    

提交回复
热议问题