你好stackoverflow社区,我遇到了一个问题,我的查询字符串不起作用,并且它在javascript中,我使用isset和empty测试结果,并且一直说失败。这是代码:
events:'load.php?loadfor="$id"',
代码位于全日历脚本中,我想为特定人员加载事件。完整代码:
$(document).on('click', '.click_hire', function(){
var to_user_id = $(this).data('touserid');
$id = $(this).data('touserid');
var calendar = $('#calendar').fullCalendar({
nextDayThreshold: '23:59:00',
forceRerenderToDisplay: true,
disableDragging: true,
header:{
left:'prev,next today',
right:'title',
center:''
},
events:'load.php?loadfor="$id"',
selectable:true,
selectHelper:true,
select: function(start, end, allDay)
{
$("#popup").show();
var start = $.fullCalendar.formatDate(start, "YY-MM-DD HH:mm:ss");
var end = $.fullCalendar.formatDate(end, "YY-MM-DD HH:mm:ss");
$.ajax({
url:"get.popup.php",
method:"POST",
data:{start:start, end:end, to_user_id:to_user_id},
success:function(data){
$('#popup').html(data);
}
})
}
});
});
为了进行测试,我将其放在了我的get.popout.php中。
if(isset($_GET['loadfor']))
{
echo "<h1>Success</h1>";
}
else if(empty($_GET['loadfor']))
{
echo "<h1>Failed</h1>";
}