如何让域名保留在地址栏

发布于 2024-07-08 17:33:43 字数 37 浏览 3 评论 0原文

除了使用主机之外,是否有更好的方法来保持地址栏中的域名不变?

Is there a better way to keep the domain name unaltered in the adress bar besides using a main frame?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北城孤痞 2024-07-15 17:33:43

使用框架(或其他一些内部窗口,通过 Flash 或 Silverlight 等)确实是唯一的方法 - 如果您尝试使用 JavaScript 修改主窗口的位置,它会将页面的位置更改为您指定的 URL ,所以这也不会真正起作用。

您应该注意RESTful原则 - 目的是什么不允许地址栏中的 URL 反映用户在域中的真实位置?

Using a frame (or some other inner window, via Flash or Silverlight, etc.) really is the only way to do it - if you try to modify the main window's location with JavaScript, it will change the page's location to the URL you specify, so that will not really work either.

You should be mindful of RESTful principles - what is the intent for not allowing the URL in the address bar to reflect the true location of the user within the domain?

盗心人 2024-07-15 17:33:43

您可以使用 AJAX 来更改页面内容,而无需更改地址。

但是,如果数据位于另一个域,则地址应更改为指向该域。 另外,建议将该地址添加为书签,以便用户可以轻松返回数据。 地址应该反映它指向的资源的内容。

You can use AJAX to change the content of the page without changing the address.

However, if the data is located on another domain then the address should change to point to that domain. Also, it is recommended that the address can be bookmarked so user's can easily return to the data. The address should reflect the content of the resource it points to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文