1
我从FullCalender谈到Javascript对象值转换为全局变量
对象events: [
<?
$sql = "Query removed";
if ($result=mysqli_query($link,$sql))
{
// Fetch one and one row
while ($row=mysqli_fetch_assoc($result))
{
echo " {
title: '".$row['eName']."',
backgroundColor: 'green',
start: '".$row['scheduledDate']."',
eventID: '".$row['eID']."'
}, " ;
}
// Free result set
mysqli_free_result($result);
}
?>
],
eventClick: function(event) {
$('#modifydialog').dialog('open');
$("#notes").val(event.eventID);
var eID = event.eventID;
}
我拼命想使一个对象(event.eventID成一个全局变量,所以我可以在这里使用它:
var eID = '';
// handles the click event for link 1, sends the query
function getOutput() {
getRequest(
'checkDelete.php?sID=<?echo $sID;?>&eID='+eID, // URL for the PHP file
drawOutput, // handle successful request
drawError // handle error
);
基本上,我试图采取的价值,并弹出到了GET语句阿贾克斯网址 - 我愿意听取建议,如果有更好的方法,谢谢你的任何意见
当我尝试,它返回为“未定义” ......我会发布更多的代码 - –
你的回答工作,我相信 - 我有一些其他问题我没有意识到我有。谢谢。 –
@RobertDickey我很高兴能帮上忙。祝你好运。 – Titus