Bootstrap、Angular.js 和 Ember.js 中使用的数据属性选项是否与 Unobtrusive Javascript 原则冲突? [英] Don't the data attribute options used in Bootstrap, Angular.js, and Ember.js conflict with Unobtrusive Javascript principles?

查看:18
本文介绍了Bootstrap、Angular.js 和 Ember.js 中使用的数据属性选项是否与 Unobtrusive Javascript 原则冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直被告知将 JavaScript 与 HTML 标记分开是一种很好的做法(ala 'unobtrusive javascript').但是,我已经看到了一些新的流行框架的相反趋势,例如 Bootstrap、Angular.js 和 Ember.js.有人能告诉我为什么这不被认为是不好的做法吗?

I've always been told it's good practice (ala 'unobtrusive javascript') separate JavaScript from HTML markup. However, I've been seeing the opposite trend with a number of new and popular frameworks such as Bootstrap, Angular.js, and Ember.js. Can someone tell me why this isn't considered bad practice?

推荐答案

Unobtrusive Javascript 是网络上许多地方的好习惯.您提到的框架通常用于创建成熟的 Javascript 应用程序.在许多这些应用程序中,没有 Javascript 的体验通常是一个空白页面.在那种环境下,将标记与 Javascript 分离的价值相对较低.

Unobtrusive Javascript is a good practice for many places on the web. The frameworks you mentioned are often used for creating full-blown Javascript applications. In many of these apps, the experience without Javascript is often a blank page. In that environment, the value of separating your markup from Javascript is relatively low.

这篇关于Bootstrap、Angular.js 和 Ember.js 中使用的数据属性选项是否与 Unobtrusive Javascript 原则冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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