对于使用 Ajax 的左侧导航面板,我应该使用 HTML 框架还是 DIV?

发布于 2024-07-24 13:57:29 字数 95 浏览 2 评论 0原文

我打算有一个左侧导航面板,它使用 ajax 请求来更改 HTML 中心面板的内容。

我应该使用 HTML 框架还是仅仅使用“侧边栏”DIV? 有关系吗?

I was going to have a left navigation panel which uses an ajax request to change the contents of the center panel of the HTML.

Should I use HTML frames or simply a "sidebar" DIV? Does it matter?

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

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

发布评论

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

评论(5

山川志 2024-07-31 13:57:29

一个分区。 你几乎不应该使用框架。 这样做会导致其他人已经描述过的问题

A div. You should pretty much never use frames. Doing so causes problems, which others have described.

蝶…霜飞 2024-07-31 13:57:29

你永远不应该使用框架。 这是非常糟糕的可用性。
请参阅“避免使用框架”和为什么框架很糟糕(大多数时候)

加载内容并将其绑定到 div。 这是动态更新页面的最佳解决方案。

jQuer.load
jQuery.post

You should never use frames. That is very bad usability.
See "Avoid using frames" and Why Frames Suck (Most of the Time)

Load the content and bind it to the div. That's the best solution for dynamically updating a page.

jQuer.load
jQuery.post

拒绝两难 2024-07-31 13:57:29

如果您使用 Ajax,那么 IFRAME 就没有意义。 另一方面,使用 iframe 可以让用户在他正在访问的页面之间后退/前进。 但我不明白您对将 Ajax 和 IFRAME 链接在一起有何想法。 谷歌这样做正是为了我上面几行提到的目的,允许用户向后(不向前),但我不知道他们是如何实现的。

If you're using Ajax, then an IFRAME makes no sense. On the other hand, using an iframe lets your user go back/forward between the pages he's visiting. But I don't understand what are your thoughts about linking together Ajax and an IFRAME. Google does this exactly for the purpose I mentioned a few lines above, to allow users to go backwards (no forward), but I don't know how they've implemented it.

恍梦境° 2024-07-31 13:57:29

两种方法都有缺点。 暂时将两者共同的问题放在一边:

  • 使用框架会给您带来孤立页面。
  • 使用 Ajax 意味着它需要 JavaScript 支持并完全锁定搜索引擎的内容(首页除外)。 它破坏了后退按钮。

原因为什么几乎每一方在多个视图上实现通用内容都只包含通用内容的重复项每个页面上的内容。

Both approaches have drawbacks. Leaving the problems that are common to both aside for the moment:

  • Using frames gives you orphan pages.
  • Using Ajax means that it requires JavaScript support and locks out search engines from the content (except for the front page) entirely. It breaks the back button.

There are reasons why almost every side that implements common content on mutiple views just includes duplicates of the common content on every page.

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