【发布时间】:2020-07-29 08:34:49
【问题描述】:
当我上传到 File Zilla 时,我收到了这条消息 - Failed to load resource: the server responded with a status of 404 (Not Found) https://england-cities.html。
当我在第一个选择菜单中选择一个国家时,它应该允许用户在另一个选择菜单中选择城市。
当我实时使用 Visual Studio Code 时,代码运行良好。但是当我出于某种原因上传到 File Zilla 时无法正常工作。
正如您在代码中看到的那样,我要求加载每个 Html 内部的数据列表,然后我使用回调函数连接到 Ajax 天气 API。
为什么会这样?
感谢您的帮助。
$(document).ready(function () {
$('#country').change(function () {
$('#counties').load($(this).val() + '-cities' + '.html');
$('#counties').change(function () {
let stateSelected = $(this).val();
getTheWeatherData(stateSelected);
});
});
});
【问题讨论】:
-
添加您的 html 以在此处运行 sn-p
-
完整代码在这里 - jsfiddle.net/lmanhaes/cq1g5dyt/25
标签: javascript jquery html drop-down-menu http-status-code-404