如何使用 javascript 到 "get" github 上已知的相对子目录?
How do I use javascript to "get" a known, relative subdirectory on github?
我在 github 上托管一个网页:https://jaitnium.github.io/popularLocationsDemo/flickrTest.html。
我正在尝试 "get" 一个已知的子目录,使用:
$.get("mapData/2015/May/.", function(data) {
...
}
但我收到“找不到 404 文件”错误:
jquery.min.js:4 GET https://jaitnium.github.io/popularLocationsDemo/mapData/2015/May/ 404 (Not Found)
如何确定 "get" 子目录的正确路径? github 是否有特殊的方法来执行此操作,因为当我的网站由 google 托管时这种方法有效?我也尝试过:
https://github.com/Jaitnium/Jaitnium.github.io/tree/master/popularLocationsDemo/mapData/2015/May
和
https://jaitnium.github.io/popularLocationsDemo/mapData/2015/May/
无济于事。
您无法“读取”目录。如果您希望列出其内容,GitHub(可能还有其他网站)不允许这样做。相反,请求一个文件:
$.get("mapData/2015/May/Paris_May_2015.json", function(data) {
...
}
我在 github 上托管一个网页:https://jaitnium.github.io/popularLocationsDemo/flickrTest.html。
我正在尝试 "get" 一个已知的子目录,使用:
$.get("mapData/2015/May/.", function(data) {
...
}
但我收到“找不到 404 文件”错误:
jquery.min.js:4 GET https://jaitnium.github.io/popularLocationsDemo/mapData/2015/May/ 404 (Not Found)
如何确定 "get" 子目录的正确路径? github 是否有特殊的方法来执行此操作,因为当我的网站由 google 托管时这种方法有效?我也尝试过:
https://github.com/Jaitnium/Jaitnium.github.io/tree/master/popularLocationsDemo/mapData/2015/May
和
https://jaitnium.github.io/popularLocationsDemo/mapData/2015/May/
无济于事。
您无法“读取”目录。如果您希望列出其内容,GitHub(可能还有其他网站)不允许这样做。相反,请求一个文件:
$.get("mapData/2015/May/Paris_May_2015.json", function(data) {
...
}