不要将数据属性的引导,Angular.js的选项,并与非侵入式JavaScript原则Ember.js冲突? [英] Don't the data attribute options used in Bootstrap, Angular.js, and Ember.js conflict with Unobtrusive Javascript principles?
问题描述
我一直说这是很好的做法(ALA非侵入式JavaScript')从HTML标记单独的JavaScript。不过,我已经看到了一些新的和流行的框架,如引导,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?
推荐答案
非侵入式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.
这篇关于不要将数据属性的引导,Angular.js的选项,并与非侵入式JavaScript原则Ember.js冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!