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吗?如果有,是否有回应?