使用 iframe 或模板
你好: 在我们的应用程序中,有很多子页面和菜单,例如:
整个站点的主菜单:
Index/Document/News/SysConfig and etc.
在 Sysconfig 页面内,还有其他菜单,例如:
user managment,roles,logs... and etc.
现在我们使用 iframe 来进行站点的布局,我们根据用户的选择更改相关 iframe 的 src 属性。但我想知道这是个好主意吗?
我想使用模板,例如jsp中的apachetile和asp.net中的masterpage。
我想知道哪种做法是最好的?
Hi:
In our application,there are so many sub pages and menus,for example:
the main menu for the whole site:
Index/Document/News/SysConfig and etc.
And inside the Sysconfig page,there are also other menus like :
user managment,roles,logs... and etc.
Now we use the iframe to make the layout of the site,we change the related iframe's src attribute according to user's choice. but I wonder if this is a good idea?
I thought use the tempalte,for example the apache tiles in jsp and the masterpage in asp.net.
I wonder which is the best pratice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最佳实践是采用模板化路线...
我已经很长时间没有真正研究过网络可访问性了...但是在过去,当我曾经在面向外部的网站上工作时,使用任何类型的框架都是一个很大的问题不不。屏幕阅读器在处理包括 iframe 在内的框架时会遇到问题。我不确定当前一代的屏幕阅读器是否可以更好地处理它们。
还有搜索结果/深层链接问题需要考虑。例如,您的 google 结果链接会直接指向 iframe 中的页面吗?您是否需要进行黑客攻击才能将用户重定向到主页?
只要您没有大量内容需要迁移,采用模板化路线可能并不那么困难。如果您有更复杂的需求,有一些很棒的内容管理解决方案,例如 Wordpress、Drupal 和 Joomla。
Best Practice would be to go the templated route ...
I haven't really looked into web accessibility for a long time ... but in the past when I used to work on externally facing sites, using frames of any sort was a big no-no. Screen readers would have problems with frames including iframes. I'm not sure if the current generation of screen-readers handle them better.
There's also the search result/deep linking issues to consider. For example, will your google result link point directly to the page in the iframe? do you have to do a hack to redirect the user to the main page?
Also going the templated route may not be that difficult as long as you don't have a lot of content to migrate. There are fantastic content management solutions out there like Wordpress, or Drupal and Joomla if you have more complex needs.