Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
加载网页后,我使用 window.location.hash 将信息添加到 URL。由于我购买了一个重定向到我的服务器 IP 的域名,它不再工作了。仅显示 domainname.com。虽然执行了散列操作。可能是什么原因?
您没有使用正确的域托管。
而不是将域指向您服务器的 IP 地址(如果您在那里处理多个站点,则配置 Web 服务器以支持虚拟名称托管),而是让您的域注册商将域指向他们提供简单 Web 的服务器由框架组成的页面(这称为“域转发”、“域掩码”或“Yuck”)。
当您设置 时location.hash,您正在设置框架的位置,而不是窗口。
location.hash