使用Ext JS或类似工具时如何进行渐进增强?

发布于 2024-09-06 08:57:59 字数 52 浏览 8 评论 0原文

是否需要为应用程序开发两个几乎独立的前端,一个使用 Ext JS,另一个根本不使用 JS?

Does it require development of two almost separate front-ends for the app, one using Ext JS and the other one with no JS at all?

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

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

发布评论

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

评论(2

风筝在阴天搁浅。 2024-09-13 08:57:59

嗯,差不多了。如果您确实想要网站的 NO-JS 版本,则需要坚持使用非常基本的 HTML,然后返回服务器并通过任何点击完全重新加载。如果您希望您的真实站点是 ajaxy,那么这将需要该站点有两个不同的前端。

请问,为什么担心不会 JavaScript 的人呢?没有 JavaScript 的人很少,即使手机也有不错的 JavaScript 性能。

Well, pretty much. If you really want a NO-JS version of your site, you will need to stick to very basic HTML, and a trip back to the server and a full reload with any click. If you want your real site to be ajaxy, then this would require two different front ends to the site.

May I ask, why are you worried about people with no JavaScript? There are very few people out there with no JavaScript, even mobile phones have decent JavaScript performance.

要走干脆点 2024-09-13 08:57:59

您的应用程序应该构建为允许没有 js 的用户访问相同的内容。
应用程序上的所有表单帖子和操作都必须有服务器端处理。出于安全原因,这是为了允许非 js 浏览器,因为 js 可以被黑客即时编辑。

一旦你有了这个基本功能,你就可以开始添加你的 css 以使其看起来不错,并添加 js 以通过 ajax 完成回发来添加附加功能。
您应该在 css 和 javascript 中使用功能检测而不是浏览器检测,因为浏览器一直在更新新的支持。

因此,您只需要一个包含两种解决方案的前端。

Your application should be built to allow users without js to access the same content.
All form posts and action on the app must have server side handling. This is to allow for non-js browsers as well for security reasons as the js can be edited on the fly by hackers.

Once you have this basic functionality you can start adding your css to make it look good and add the js to add additional functionality with postbacks done by ajax.
You should use feature detection instead of browser detection with your css and javascript as browsers are updated with new support all the time.

Therefore you only need one frontend which includes both solutions.

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