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>
为什么有哟如果它不是JSONP请求,请设置dataType:'jsonp'。这几乎肯定是您的消息的来源。一个JSONP请求将会返回一些脚本。可能其他浏览器容忍你的错误,但不是Safari。如果您的ajax请求正在返回JSON数据,请尝试使用'dataType:'json''。 – ADyson
我也尝试将jsonp更改为json,但仍然出现错误 –
数据变量到达响应时的内容究竟是什么? – ADyson