Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Restful web服务不响应ajax_Ajax_Rest - Fatal编程技术网

Restful web服务不响应ajax

Restful web服务不响应ajax,ajax,rest,Ajax,Rest,我有以下代码: $(document).ready(function() { $.ajax({ type: "GET", url: "http://www.example.com/rest/api.php?request=users", dataType: "json", }).then(function(data) { $('.greeting-id').append(data); //$('.gre

我有以下代码:

$(document).ready(function() {
    $.ajax({
        type: "GET",
        url: "http://www.example.com/rest/api.php?request=users",
        dataType: "json",

    }).then(function(data) {
       $('.greeting-id').append(data);
       //$('.greeting-content').append(data.content);
    });
});
但是看不到任何数据。
当我在浏览器中复制web服务的粘贴url时,它工作正常。有什么想法吗?

也许
那么
与此有关吗?1。控制台日志里有什么吗?2.在“json”后面加逗号是否正常?请查看控制台。在网络面板上,您可以看到正在发布的GET吗?如果有,是否有回应?