对于阿贾克斯 - 哈希VS HTML 5 API的历史? [英] For ajax - Hashes vs HTML 5 History API?

查看:129
本文介绍了对于阿贾克斯 - 哈希VS HTML 5 API的历史?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我启动我的网站,我想在我的石头URL结构设置。大量的我的网页对他们的标签,这是一个更好的用户体验,如果更改选项卡时,我使用AJAX来获得相关的变化,只是更新,而不是更新整个页面。

Before I launch my site, I want to get my URL structure set in stone. A large number of my pages have tabs on them, and it's a much better user experience if when changing a tab, I use ajax to get the relevant changes and just update that, rather than updating the whole page.

我应该只使用更新网址为Ajax标签变更的哈希的常用的方法,或者我应该只使用HTML 5 API的历史,并让任何人与不支持它重新加载整个页面的浏览器?我听到人们说,使用哈希和hashbangs网站是破网络。使用哈希我的网址是这样的: example.com/#popular ,并使用HTML 5的历史我的网址是这样的: example.com /?选项卡=流行

Should I use the popular method of just updating the hash of the url for ajax tab changes, or should I just use the HTML 5 history API, and let anyone with browsers that don't support it reload the full page? I've heard people say that websites that use hashes and hashbangs are "breaking the web". Using hashes my urls would look like this: example.com/#popular, and using HTML 5 history my urls would look like this: example.com/?tab=popular.

推荐答案

据我所知,从我的经验,它是真正六一和另一半打的。这真的是你preFER,因为最终的结果是一样的。

As far as I know, and from my experience it's really six of one and half dozen of another. It's really what you prefer since the end result is the same.

这篇关于对于阿贾克斯 - 哈希VS HTML 5 API的历史?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆