2017-09-27 75 views
0

我在php中有項目在谷歌瀏覽器上一切正常。但是,它不適用於Safari或Mac。顯示錯誤:fullcalendar safari上的日期無效

Resource interpreted as Script but transferred with MIME type application/json. _WidgetJPCB2.js:-1Resource interpreted as Script but transferred with MIME type application/json. _PCcb:-1Resource interpreted as Script but transferred with MIME type text/html. _PCcb:-1Resource interpreted as Script but transferred with MIME type text/html.

這裏是我的代碼

<div class="calenderarea"style="zoom:75%!important;" > 
<div class="calendarsection" ></div> 
<!------ 
style="-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover; 
background-size: cover; background:linear-gradient(rgba(230, 230, 230, 0.52), rgba(193, 193, 193, 0.09)), url('images/booking1.jpg'); 
background-size:160vh 100%;background-attachment: fixed; background-position: center center;" 
------------> 
    </div> 

這裏是我的腳本

<script> 
    function check_sv_pas_seats() { 
     var pro_id = $('#trip_id').val(); 
     $('#sv_pas_seats').empty(); 
     $('#check_my_sv_1').empty(); 
     $.ajax({ 
       type: 'POST', 
       url: 'check.php', 
       data: 'my_sv_program_id_4_seats=' + pro_id, 
       dataType: 'jsonp', 
       success: function(data) { 
        if (data >= 6) { 

         for (i = 1; i <= data; i++) { 
          $('#sv_pas_seats').append('<option value=' + i + '>' + i + '</option>'); 
         } 
         $('#check_my_sv_1').empty(); 
         $("#check_my_sv_1").val(data); 
        } else if (data == 0) { 
         alert("No seats 
          available 
          for this date "); 
         } 
         else if (data <= 5) { 
          for (i = 1; i <= data; i++) { 
           $('#sv_pas_seats').append('<option value=' + i + '>' + i + '</option>'); 
          } 
          $('#check_my_sv_1').empty(); 
          // document.getElementById('check_my_sv_1').value = data; 
          $("#check_my_sv_1").val(data); 

         } else if (data == 000000) { 
          alert('Error!!! please try again. Type - 1'); 
         } else { 
          alert('Error!!! please try again.'); 
         } 
        } 
       }); 
     } 

     function myfunc() { 
      var sval_1 = $("#sv_pas_seats").val(); 
      var sval_2 = $("#check_my_sv_1").val(); 
      var sum = sval_2 - sval_1; 
      $('#ch_seats').empty(); 
      for (i = 1; i <= sum; i++) { 
       $('#ch_seats').append('<option value=' + i + '>' + i + '</option>'); 
      } 
     } 

     function mychild3() { 
      $('#s_ncs3').show(); 
     } 

     function mychild4() { 
      $('#s_ncs3').hide(); 
     } 
</script> 
+0

爲什麼有喲如果它不是JSONP請求,請設置dataType:'jsonp'。這幾乎肯定是您的消息的來源。一個JSONP請求將會返回一些腳本。可能其他瀏覽器容忍你的錯誤,但不是Safari。如果您的ajax請求正在返回JSON數據,請嘗試使用'dataType:'json''。 – ADyson

+0

我也嘗試將jsonp更改爲json,但仍然出現錯誤 –

+0

數據變量到達響應時的內容究竟是什麼? – ADyson

回答

0

我發現在Safari時間變量的錯誤
居然變成無效,這就是爲什麼有錯誤 現在我固定它