您好我需要知道是否有可能没有窗体有一个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