我目前正在处理日历。在日历旁边,我想要一个描述框,其中当用户单击日历中的日期时,应该显示有关该事件的更多信息。通过AJAX传输变量
我直到现在: HTML/PHP:
// Variables from MySQL request:
$event
$date
$place
$start
$end
<button type="button" onclick="event_description()">$day</button>
<div id="details"></div>
AJAX:
function event_description() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("details").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "kalender/description.php", true);
xhttp.send();
}
所以我能做些什么,所以我可以使用MySQL变量在description.php?
感谢您的帮助!
你被点名功能'kalendar_description'和绑定'event_description' –
对不起,这是一个错误。在我的脚本中是正确的,它只是在其他语言,所以我犯了一个错误翻译:) –