对于使用 Ajax 的左侧导航面板,我应该使用 HTML 框架还是 DIV?
我打算有一个左侧导航面板,它使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
一个分区。 你几乎不应该使用框架。 这样做会导致其他人已经描述过的问题。
A div. You should pretty much never use frames. Doing so causes problems, which others have described.
许多人反对使用框架:http://www.google .ca/search?hl=en&q=html+frame+问题
Many people argue against using frames: http://www.google.ca/search?hl=en&q=html+frame+problems
你永远不应该使用框架。 这是非常糟糕的可用性。
请参阅“避免使用框架”和为什么框架很糟糕(大多数时候)
加载内容并将其绑定到 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
如果您使用 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.
两种方法都有缺点。 暂时将两者共同的问题放在一边:
原因为什么几乎每一方在多个视图上实现通用内容都只包含通用内容的重复项每个页面上的内容。
Both approaches have drawbacks. Leaving the problems that are common to both aside for the moment:
There are reasons why almost every side that implements common content on mutiple views just includes duplicates of the common content on every page.