显示网络浏览器提供的html文件的名称 [英] show name of the html file served by the web browser

查看:194
本文介绍了显示网络浏览器提供的html文件的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在我的Javascript控制台中显示在仅在浏览器地址栏中键入域名时浏览器已加载的 home 文件。 anydomain.com)。是 index.html index.php index.htm ...?

I want to to be able to display in my Javascript console which home file the browser has loaded when only the domain name has been typed in the browser address bar (e.g. anydomain.com). Is it index.html, index.php, index.htm ...?

我似乎无法在DOM中找到记录此内容的任何内容。我已经尝试过 document.URL documentURI window.location ,但在这种情况下,所有这些仅返回域名。

I can't seem to find anything in the DOM that records this. I've tried document.URL, documentURI, window.location, but all of these simply return the domain name in this case.

这是服务器的私有业务,并且不告诉DOM吗?还是我错过了什么?

Is it that this is the server's private business and it doesn't tell the DOM? Or am I missing something?

谢谢。

推荐答案


这是服务器的私有业务,并且不告诉DOM吗?

Is it that this is the server's private business and it doesn't tell the DOM?

是。

客户端在给定URL处请求资源。服务器使用该资源进行响应。

The client asks for a resource at a given URL. The server responds with that resource.

通常没有提供有关服务器用于生成该响应的进程的信息。它可能已经读取了一个文件,可能已经访问了一个数据库,它可能完全是从HTTP服务器本身的软件内部生成的,等等。

There is generally no information provided about what process the server used to generate that response. It might have read a file, it might have accessed a database, it might have generated it entirely from inside the software of the HTTP server itself, etc.

这篇关于显示网络浏览器提供的html文件的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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