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