Ajax请求不适用于Safari,但在chrome / firefox上完美运行?

时间:2018-03-08 13:41:16

标签: javascript php ajax

这是我的ajax,它完全适用于chrome和firefox,但不适用于safari,我不知道这里有什么问题? js加载良好,但控制台中没有任何反应

 $(document).ready(function () {
     //NEW
     function checkMsg() {
         setTimeout(function () {
             $.ajax({
                 url: '/checkmsg.php?msg=1&rand=' + new Date().getTime(),
                 type: "GET",
                 success: function (data) {
                     console.log(data);
                     if (data && data != 0) {
                         $('#redheadmsg').show();
                         $('#redheadmsg').html(data);
                     }
                     if (data == 0) {
                         $('#redheadmsg').hide();
                     }
                 }
             });

             checkMsg();
         }, 5000);
     }

     checkMsg();
 });

0 个答案:

没有答案