您好我需要知道是否有可能沒有窗體有一個Ajax GET調用。無法獲得呼叫嗎?
我想:
$(".edit_event").live("click", function() {
var currentID = $(this).data("event-id");
var currentTable = $(this).data("table");
if (currentTable == 'Coffee_talk') {
alert('Erzaehlcafe mit ID' + currentID);
$.ajax({
url: 'index.php?section=event_select&id=' + currentID + '&table=' + currentTable,
type: 'GET',
dataType: 'json',
success: function (select) {
alert(select);
}
});
return false;
} else if (currentTable == 'Presentation') {
alert('Vortrag mit ID' + currentID);
} else if (currentTable == 'Exhibition') {
alert('Ausstellung mit ID' + currentID);
}
});
調試與螢火蟲說,有一個GET調用與ID和表,但我沒有得到任何值回(無JSON也不是PHP的回聲)。
這是我的PHP:
if ('GET' == $_SERVER['REQUEST_METHOD']) {
if ($_GET['table'] == 'Coffee_talk') {
echo ('test');
$response['code'] = '1';
echo json_encode($response);
}
if ($_GET['table'] == 'Presentation') {
}
if ($_GET['table'] == 'Exhibition') {
}
}
只是使用了一些測試值。
[堆棧溢出不需要你的搜索引擎優化技巧](http://meta.stackexchange.com/a/130208/143302) – Filburt