Apache Cordova:“加载资源失败:服务器响应状态为 404(未找到)”

     2023-03-27     124

关键词:

【中文标题】Apache Cordova:“加载资源失败:服务器响应状态为 404(未找到)”【英文标题】:Apache Cordova: "Failed to load resource: the server responded with a status of 404 (Not Found)" 【发布时间】:2016-01-04 08:48:27 【问题描述】:

我收到错误消息:“加载资源失败:服务器响应状态为 404(未找到)”,图标文件位于 javascript 文件中。

试图在谷歌地图中显示一个标记。

var image = 
                url: "green.png",
                size: new google.maps.Size(20, 32),
                origin: new google.maps.Point(0, 0),
                anchor: new google.maps.Point(0, 32)
            ;

var marker = new google.maps.Marker(
                position:  lat: latitude, lng: longitude ,
                map: map,
                icon: image,
                title: ""
            );

我正在使用带有 Apache Cordova 的 Visual Studio 2015。

文件位于 www/scripts/googlemap.js 和 www/scripts/green.png。

编辑: 主要问题是来源。网址应该是 /scripts/green.png 或 scripts/green.png。我以为我以前尝试过这些,但由于某种原因没有让它们工作。

【问题讨论】:

【参考方案1】:

我没有使用任何插件。带有 API 的基本 javascript 谷歌地图。

我已经回答了我的第一篇文章,但问题是来源。网址应该是 /scripts/green.png 或 scripts/green.png。我以为我之前尝试过这些,但由于某种原因没有让它们工作。

有时在 Visual Studio Rebuild 中不起作用。必须先清理然后再构建。也许这是第一次出现问题。不知道。但现在一切顺利!

【讨论】:

“加载资源失败:服务器响应状态为 404”express docker

】“加载资源失败:服务器响应状态为404”expressdocker【英文标题】:"Failedtoloadresource:theserverrespondedwithastatusof404"expressdocker【发布时间】:2019-01-2720:38:51【问题描述】:我在浏览器中收到错误消息“加载资源失败:服务器... 查看详情

错误:加载资源失败:服务器响应状态为 404(未找到)

】错误:加载资源失败:服务器响应状态为404(未找到)【英文标题】:Error:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2017-07-0304:36:14【问题描述】:这是我第一次在线上传网站。Here是链接。我正在使用轮... 查看详情

加载资源失败:服务器响应状态为 404(未找到)

】加载资源失败:服务器响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NOTFOUND)【发布时间】:2013-03-3003:23:16【问题描述】:我是uisngpython,要将数据从json文件显示到页面,我收到以下错误Fail... 查看详情

这是啥意思? “加载资源失败:服务器响应状态为 405(不允许方法)”

】这是啥意思?“加载资源失败:服务器响应状态为405(不允许方法)”【英文标题】:Whatdoesthismean?"Failedtoloadresource:theserverrespondedwithastatusof405(MethodNotAllowed)"这是什么意思?“加载资源失败:服务器响应状态为405(不允... 查看详情

加载资源失败:服务器响应状态为 439(应用程序不活动)

】加载资源失败:服务器响应状态为439(应用程序不活动)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof439(Applicationinactive)【发布时间】:2017-03-1513:22:25【问题描述】:我在VisualStudio2015中开发一个Web应用程序,我的浏... 查看详情

Web 窗体 Azure 活动目录:加载资源失败:服务器响应状态为 401

】Web窗体Azure活动目录:加载资源失败:服务器响应状态为401【英文标题】:WebformAzureActivedirectory:Failedtoloadresource:theserverrespondedwithastatusof401【发布时间】:2020-03-3011:15:10【问题描述】:我有一个网站(Web表单、实体框架)并且... 查看详情

错误加载资源失败:服务器响应状态为 403 () en angular

】错误加载资源失败:服务器响应状态为403()enangular【英文标题】:ERRORFailedtoloadresource:theserverrespondedwithastatusof403()enangular【发布时间】:2020-03-1703:16:08【问题描述】:ErrorsIget错误:Failedtoloadresource:theserverrespondedwithastatusof403()logi... 查看详情

加载资源失败:服务器响应状态为 404(未找到)

】加载资源失败:服务器响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatus404(notfound)【发布时间】:2015-12-0117:06:28【问题描述】:我在javascript和ajax上遵循lynda教程,并在主题“使用同步XHR请求”主... 查看详情

加载资源失败:服务器响应状态为 421(错误请求)

】加载资源失败:服务器响应状态为421(错误请求)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof421(BadRequest)【发布时间】:2015-06-1621:17:14【问题描述】:我正在使用Apple的新CloudKitJS参考和示例代码来构建一个简单的CR... 查看详情

加载资源失败:服务器响应状态为 404(未找到)

】加载资源失败:服务器响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2014-07-1520:37:19【问题描述】:我在Eclipse中使用WorklightStudio。我创建了一个新工作区并创建了一个... 查看详情

收到错误消息;加载资源失败:服务器响应状态为 500

】收到错误消息;加载资源失败:服务器响应状态为500【英文标题】:Gettinganerrormessage;Failedtoloadrescources:theserverrespondedwithastatusof500【发布时间】:2018-08-1113:41:18【问题描述】:我正在创建一个应用程序,但我注意到当我尝试在... 查看详情

Steam 发布请求 - 加载资源失败:服务器响应状态为 400(错误请求)

】Steam发布请求-加载资源失败:服务器响应状态为400(错误请求)【英文标题】:SteamPostRequest-Failedtoloadresource:theserverrespondedwithastatusof400(BadRequest)【发布时间】:2014-10-2503:48:29【问题描述】:我正在尝试发送这样的帖子请求:xhr... 查看详情

散景内联嵌入,“加载资源失败”

】散景内联嵌入,“加载资源失败”【英文标题】:BokehInlineEmbedding,\'Failedtoloadresource\'【发布时间】:2017-01-0313:31:03【问题描述】:我在嵌入Bokeh内联时遇到问题。特别是,从“链接”标签加载资源时存在问题(请参阅下面的html... 查看详情

加载资源失败:服务器响应状态为 404(未找到)显示在控制台上

】加载资源失败:服务器响应状态为404(未找到)显示在控制台上【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)displayedonconsole【发布时间】:2021-10-2319:00:43【问题描述】:Image我的文件结构是index.html、script.js... 查看详情

Angular 5 - 加载资源失败:服务器响应状态为 404(未找到)

】Angular5-加载资源失败:服务器响应状态为404(未找到)【英文标题】:Angular5-Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2018-09-0703:44:17【问题描述】:我正在尝试从node_modules中的包中获取svg图像,我从我... 查看详情

加载资源失败:服务器响应状态为 404 () font-awesome [重复]

】加载资源失败:服务器响应状态为404()font-awesome[重复]【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404()font-awesome[duplicate]【发布时间】:2021-11-0923:32:12【问题描述】:我正在使用jsf和adminlte主题。我在使用图标时遇到... 查看详情

加载资源失败:服务器从 Angularjs 响应状态为 405(不允许方法)到 WebApi

】加载资源失败:服务器从Angularjs响应状态为405(不允许方法)到WebApi【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof405(MethodNotAllowed)fromAngularjstoWebApi【发布时间】:2017-10-1901:44:57【问题描述】:我正在使用AngularJS调用... 查看详情

加载资源失败:服务器使用 Angular 响应状态为 404 (),使用 GitHub Pages 部署

】加载资源失败:服务器使用Angular响应状态为404(),使用GitHubPages部署【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404()usingAngular,deployingwithGitHubPages【发布时间】:2021-07-3020:49:51【问题描述】:我正在尝试使用Angular和Gi... 查看详情