pjax 是实现“流畅”的方法吗?导航?

发布于 2024-11-09 17:38:42 字数 831 浏览 4 评论 0原文

我开始使用 pjax,因为我想为我的用户提供快速、流畅的体验,而无需大量不必要的 HTTP 请求以及重复呈现未更改的 HTML。

我让它在我的网站上运行得相当好,而且我必须说,考虑到它对体验的影响有多大,它的启动和运行非常容易。

然而,我发现对 pjax 的支持非常少——两者都在 pjax 上。 com/search?q=pjax">StackOverflow,以及一般网络上(google 搜索 返回许多结果完全 与 Web 开发无关)。

但正如我对它印象深刻的那样,即使它尚未得到广泛支持,我仍然可能会使用它。我主要担心的是,当我在没有大量支持的情况下将代码投入其中时,稍后会遇到大问题。所以我想确保那里没有其他东西。

是否有其他方法可以实现我不知道的 pjax 提供的相同功能?或者它太新了以至于没有多少人知道它?或者,这只是一个糟糕/有问题的实施?

I've started playing with pjax, as I want to provide a fast, fluid experience for my users without a lot of unnecessary HTTP requests and repeated rendering of unchanged HTML.

I have it working fairly well on my site, and I must say it was surprisingly easy to get up and running, considering how much a difference it makes for the experience.

However, I'm seeing very little support for pjax -- both on StackOverflow, and on the web in general (a google search returns many results at the top totally unrelated to web development).

But as impressed I am with it, even if it's not widely supported yet, I may still use it. My main concern is running into big problems later when I've already invested my code in it without a lot of support. So I wanted to make sure there wasn't something else out there.

Are there alternatives for implementing the same functionality that pjax provides that I'm not aware of? Or is it so new that not many people know about it yet? Or, is it just a bad/problematic implementation?

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

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

发布评论

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

评论(5

春风十里 2024-11-16 17:38:42

http://caniuse.com/#search=history 将为您提供支持当前内容的指示pjax 版本。

嗅探 PJAX 标头请求的服务器端代码也可以对浏览器做出反应,并在其他浏览器中很好地降级。

http://forum.kohanaframework.org/discussion/8869/kopjax-simplistic-pjax-jquery-ajax-module/p1#Comment_60090 是一个不错的替代选项列表。

如果您不介意缺少对其他浏览器的支持或进行更改,那么我可以看到 PJAX 的唯一缺点是需要 1 个块/部分进行更新。

http://caniuse.com/#search=history will give you an indication of what supports the current version of pjax.

The severside code that sniffs the request for PJAX header could also react to the browser and degrade nicely for other browsers.

http://forum.kohanaframework.org/discussion/8869/kopjax-simplistic-pjax-jquery-ajax-module/p1#Comment_60090 is a decent list of alternate options.

If you don't mind missing support for other browsers or make changes to do so then PJAX's only draw back I can see is the need to have 1 chunk/partial to update.

ˉ厌 2024-11-16 17:38:42

我在尝试解决 1 个容器部分更新限制时遇到了问题,因此我整理了一个可以优雅降级的简单替代方案。 djax 实现与 pjax 相同的结果,除了它对页面之间的布局变化无关,并且允许您更新尽可能多的部分在页面上,如您所愿。

I was running into issues trying to work around the 1 container partial update limitation, so I put together a simple alternative that degrades gracefully. djax achieves the same result as pjax, except it is indifferent to layout changes between pages, and allows you to update as many partials on the page as you like.

鹿! 2024-11-16 17:38:42

我支持 Jerad - 基于在 IE 中使用 演示,它似乎可以正常降级。

如果您可以忍受某些用户无法获得 AJAX 体验,我认为没有什么可失去的。

I'm with Jerad - based on using the demo in IE, it appears to degrade gracefully.

If you can live with some users not getting the AJAX experience, I don't see anything to lose.

滥情空心 2024-11-16 17:38:42

我还收到“抱歉,不支持”消息。

从这里指出的浏览器支持问题来看,我想说,虽然 pjax 听起来很有趣,但它可能还没有准备好迎接黄金时段。

它在 Firefox 3.6 中不起作用,但这是一个小问题,因为 FF4 现已可用。但在可预见的未来,真正的阻碍者是 IE。如果该产品甚至不受 IE9 支持,那么使用它实际上并没有给自己带来任何好处。

但随着目前浏览器世界的变化速度,这将会有所改善,所以请随意尝试它,以期在以后实现它——如果这个答案完全不同,我不会感到惊讶。一年的时间——但就目前而言,我想说的是:一种实验性的好奇心。

I'm also getting "Sorry, not supported" messages.

Judging by the browser support issues pointed out here, I would say that while pjax sounds interesting, it probably isn't ready for the prime-time yet.

It doesn't work in Firefox 3.6, but that's a minor issue as FF4 is now available. But for the foreseeable future, your really big blocker is IE. If the product isn't even supported by IE9, then you're really not doing yourself any favours by using it.

But with the rate of change in the browser world at the moment, this will improve, so feel free to experiment with it with a view to implementing it at a later date -- I wouldn't be suprised if this answer is completely different in a year's time -- But for the time being I'd say that's all it is: an experimental curiosity.

╰つ倒转 2024-11-16 17:38:42

Pjax 是一个很好的解决方案,并且可以优雅地降级。如果你想要一个更深入的解决方案,你可以使用backbone-rails,但这需要更多的工作。我相信它与旧版浏览器更兼容,因为它不依赖于推送状态......

Pjax is a great solution and it degrades gracefully. If you want a more in-depth solution you can use backbone-rails but it's a bit more work. I believe it is more compatible with older browsers as it does not depend on push state...

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