错误404(未找到)的含义是什么 [英] What is meaning of error 404 (Not Found)

查看:80
本文介绍了错误404(未找到)的含义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个小型网站,其中显示了一些数据,这些数据是从API(JSON数据类型)获得的.在我的控制台中,我遇到了两个错误:

I have created a small web site, where I am showing some data, which I get from an API (JSON data type). In my console I am getting these two errors:

1)GET http://fonts.gstatic.com/s/opensans/v10/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2 404(未找到)

1) GET http://fonts.gstatic.com/s/opensans/v10/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2 404 (Not Found)

错误1)在我的代码中指向以下代码行:

error 1) is in my code pointing to this line of code:

<script src="https://maps.googleapis.com/maps/api/js"></script>

2)GET http://localhost/[object%20Event] 404(未找到)

2) GET http://localhost/[object%20Event] 404 (Not Found)

,错误2)在我的代码中指向以下代码行:

and error 2) is in my code pointing on this line of code:

function getData(url){
    return $.ajax({
        type: 'GET',
        dataType: 'json',
        url: url
    });
}

您知道这些错误是什么意思吗?这些特定的错误对网站没有影响;该网站仍在工作,并显示所有数据.

Any idea what these errors mean? These particular errors have no effect on the site; the site is still working and showing all data.

推荐答案

404代码表示服务器无法通过GET请求找到您要查找的文件.

The 404 code means that the server was unable to locate the files you were looking for via GET request.

您可以尝试将text/javascript类型添加到标签中,例如google maps api的示例.

You might try adding the text/javascript type to your tags, as the examples for google maps api do.

即:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

就您遇到的第二个问题而言,您传递给getData()函数的url似乎无效.

As far as the second problem you encountered, it looks like the url you passed into the getData() function was invalid.

这篇关于错误404(未找到)的含义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆