这是我的Ajax调用
<script>
$.ajax({
url:"http://localhost:3000/house/get-all",
type: "GET",
dataType: 'json',
data,
crossDomain: "true",
}
});
</script>
这是我的HTML代码:
<div id="houses">
This is place to put content. You can put slider, short description about your website and place some links for navigation.
</p>
</div>
错误:
未捕获的ReferenceError:未定义数据
答案 0 :(得分:1)
如果您没有在ajax选项中传递任何数据,则不需要data,
:
$.ajax({
url:"http://localhost:3000/house/get-all",
type: "GET",
dataType: 'json',
// data, -- remove this or pass something here
// ...
});