faulknercs / Knockstrap

Knockout bindings to twitter bootstrap 3
faulknercs.github.io/Knockstrap/
MIT License
142 stars 37 forks source link

Knockstrap doesn't work when npm-installed but knockout and jQuery are CDN'ed #35

Closed petemill closed 8 years ago

petemill commented 8 years ago

A website may want to request knockout and jQuery via a <script /> include to a global CDN, for performance and cross-site caching benefits. And the same website may also wish to include Knockstrap via npm, being something that adds plugins to knockout.

However, in this instance, knockstrap fails to initialise because it's knockout / jQuery require statements conflict and, since it was called in the context of 'require()', it will not fallback to the global ko and $ variables.

As a side note, the $ variable should be referenced as jQuery, in case the site is in jQuery's noConflict mode.