ajax避免预请求_避免的AJAX烦恼

ajax避免预请求

The AJAX revolution has completely reinvigorated the web. Browsers are working hard to increase the speed of their JavaScript and rendering engines. Web Developers are working as quickly as possible to push the limits of the browsers even further. Users are feeling more entitled by the user experiences provided by AJAX-heavy websites like Facebook. Before you thrust your website into the world of AJAX, be sure you're doing it for the right reasons, otherwise you may run into the following annoyances.

AJAX革命彻底使网络焕发了活力。 浏览器正在努力提高其JavaScript和呈现引擎的速度。 Web开发人员正在尽快工作以进一步扩大浏览器的限制。 像Facebook这样的AJAX繁重的网站所提供的用户体验使用户感到更有资格。 在将您的网站推向AJAX领域之前,请确保您出于正确的原因在做它,否则您可能会遇到以下麻烦。

使用AJAX是因为您可以 (Using AJAX Because You Can)

If using AJAX doesn't improve the user experience, there's a good chance that using it will cause more harm that good. There are many behaviors and functionalities you'll need to account for (paging, scroll position, "back button", etc.) that the browser traditionally handles. Add to that things like browser bookmarking and there's a good chance that using AJAX may not be the best bet, especially if you don't want to put in the development and testing time to ensure that your users wont be led down an unreliable path.

如果使用AJAX不能改善用户体验,则很有可能使用AJAX会造成更大的伤害。 浏览器通常需要处理的许多行为和功能(分页,滚动位置,“后退按钮”等)。 再加上诸如浏览器书签之类的东西,很有可能使用AJAX并不是最好的选择,尤其是如果您不想投入开发和测试时间以确保不会导致用户走上一条不可靠的道路时。

忘记滚动位置/分页 (Forgetting Scroll Position/Paging)

A lot of websites now use a cute paging technique that loads more content once you've scrolled down near the bottom of a parent element. That's great and all but if I click a link, click my browser's "Back" button, and only the first "page" of content loads, I'll hunt down the site's webmaster and shank him. I'd rather wait for a full page load than continually need to scroll to the bottom of an element to get back to where I was.

现在,许多网站都使用可爱的分页技术,一旦您向下滚动到父元素底部附近,就会加载更多内容。 一切都很好,但是如果我单击一个链接,单击浏览器的“后退”按钮,并且仅加载内容的第一个“页面”,我将搜寻该网站的网站管理员并将其甩掉。 我宁愿等待整个页面加载,也不愿持续滚动到元素底部以回到原来的位置。

不提供“反馈”图像/消息 (Providing No "Feedback" Imagery/Message)

There's nothing worse than clicking on a button and ...seeing...nothing...happen...Oh, there it is! Communicating effectively with your user is paramount to a good user experience. At least with a new page load the user would see the progress bar light up, the address bar change, and possibly even a different cursor. If you plan on creating an effective AJAX-powered site, use something like Dotter or another visual effect to communicate to the user that something is happening.

没有什么比单击按钮然后……什么都没看到……更糟糕了……哦! 与用户进行有效沟通对于获得良好的用户体验至关重要。 至少在加载新页面时,用户将看到进度条亮起,地址栏更改,甚至可能是其他光标。 如果您打算创建一个有效的AJAX驱动的网站,请使用Dotter之类的工具或其他视觉效果来向用户传达正在发生的事情。

一次发生的事情太多 (Too Many Things Happening at Once)

Too frequently do I see AJAX-driven websites that have 100 things happening at once. If there are a hundred things happening at once, how can you effectively communicate that to the user? That's quite a task. It may be best to try to chunk requests together to better show your users "progress-by-volume."

我经常看到AJAX驱动的网站同时发生100件事。 如果一次发生一百件事,您如何有效地将其传达给用户? 那是一项艰巨的任务。 最好尝试将请求分块以更好地向用户显示“按进度显示”。

有更多的? (Have More?)

I know I'm missing a few annoyances -- share them! If brave enough, cite websites that are currently making these mistakes!

我知道我错过了一些烦恼-分享吧! 如果足够勇敢,请列举当前正在犯这些错误的网站!

翻译自: https://davidwalsh.name/ajax-tips

ajax避免预请求

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值