Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/461.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 如何使用SimpleHTTPServer强制目录列表?_Javascript_Python - Fatal编程技术网

Javascript 如何使用SimpleHTTPServer强制目录列表?

Javascript 如何使用SimpleHTTPServer强制目录列表?,javascript,python,Javascript,Python,我在运行SimpleHTTPServer的文件夹中有一个index.html,但根据URL GET参数的值,我想显示一个目录列表。可能吗?我试图使用ajax查询根目录,但默认情况下它返回index.html 我想一个可能的选择是将index.html重命名为类似main.html的东西,并且永远不要使用index.html。您可以覆盖do_GET(),捕获您感兴趣的路径和参数,然后从那里做正确的事情。是这个SimpleHTTPServer吗?如果重命名index.html是一个选项,那么它是迄今

我在运行SimpleHTTPServer的文件夹中有一个
index.html
,但根据URL GET参数的值,我想显示一个目录列表。可能吗?我试图使用ajax查询根目录,但默认情况下它返回
index.html


我想一个可能的选择是将
index.html
重命名为类似
main.html
的东西,并且永远不要使用index.html。

您可以覆盖do_GET(),捕获您感兴趣的路径和参数,然后从那里做正确的事情。

是这个SimpleHTTPServer吗?如果重命名index.html是一个选项,那么它是迄今为止最简单的解决方案。事实上,这可能是一个很好的起点,即使您仍然需要调整某些GET参数的行为。你知道文件存储在哪里吗?