Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.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
Javascript XMLHttpRequest无法与jQuery一起加载_Javascript_Jquery_Json_Ajax_Xmlhttprequest - Fatal编程技术网

Javascript XMLHttpRequest无法与jQuery一起加载

Javascript XMLHttpRequest无法与jQuery一起加载,javascript,jquery,json,ajax,xmlhttprequest,Javascript,Jquery,Json,Ajax,Xmlhttprequest,我试图从我的MongoDB中检索一个JSON响应,并使用它用chartJS绘制一个图形。使用此代码 myurl = "http://localhost:5000/api/humidity" $(function() { $.ajax({ type: "GET", url: myurl, // cache: false, dataType : "json", success: function (data) {

我试图从我的MongoDB中检索一个JSON响应,并使用它用
chartJS
绘制一个图形。使用此代码

myurl = "http://localhost:5000/api/humidity"
$(function() {
    $.ajax({
        type: "GET",
        url: myurl,
       // cache: false,
        dataType : "json",
        success: function (data) {
            console.log(data);
        }
    })
})
不幸的是,我一直得到
XMLHttpRequest无法加载
错误或
404未找到

这是我的JSON数据

[{"_id":"585b544f5c86b6c8537c34d6","topic":"Humidity","message":23,"when":"2016-12-22T04:19:27.000Z"}]
我使用过各种浏览器,发现Chrome在
XMLHttpRequest


我会感激任何能得到的帮助

完整的错误消息是什么?详细信息很重要,您在搜索使用的术语时应该没有问题http://localhost:5000/test
当您将页面放入浏览器的地址栏时,该页面是否工作?
http://localhost:5000/
同样,或者页面来自其他主机?
Chrome与XMLHttpRequest有问题-不,没有t@Ekom问题在于你的代码,而不是chrome