首页题目详情
location.pathname 可以用于获取页面路径信息,例如 'page.html',如果 URL 是 'http://www.example.com/page.html',则返回?

A.http://www.example.com/page.html
B.www.example.com/page.html
C./page.html
D.http://www.example.com
优质解答
答案
C
解析
location.pathname 返回 URL 中的路径部分,不包含域名或协议,例如对于 http://www.example.com/page.html,返回 '/page.html'。
Web程序设计单选题中等AI生成