backbone.js alternatives that plays ball with jQue

2019-03-13 09:09发布

问题:

Are there any alternatives to something like backbone.js out there that provides some framework/structure to your front end javascript - but don't have any unwanted dependencies and are more closely married to jQuery?

回答1:

Are you asking for an easy to use MVC framework? because Sammy.js seems to be by far the most easy RESTful framework with routes, managing hash changes, and templating plugins.



回答2:

have you checked SproutCore

also JavaScriptMVC



回答3:

Spine

I think there's only one MVC framework that is as fully featured and still even more puristic and that's Spine http://spinejs.com/. It's not so closely married to jQuery though since it's actually not dependent on any other library.

Spine vs. Backbone

The fundamental difference between Backbone is that Spine wants to abstract the server away completely so that none of the asynchronous calls are being waited, but that the application just continues it's work while the calls are done in the background. (http://spinejs.com/docs/introduction)



回答4:

I would recommend everyone to have a look at ember.js.

Ember is much more of a high level framework with many useful features implemented implemented out of the box. For example:

  • Two way data binding
  • Computed properties
  • Auto-updating templates

On the other hand the fact that is higher level than Backbone makes it less flexible , thus less attractive for those javascript developers that like tweaking the system and getting their hands dirty.

For those interested you can find a great comparison between the two at: http://smus.com/backbone-and-ember/



回答5:

I know this is a few days old now, as well as a shameless plug - but I am the author of AFrameJS, which plays well with jQuery. There are a lot of docs there, also some on shanetomlinson.com. The source is on GitHub. K Ivanov already mentioned JavascriptMVC, and then there is KnockoutJS. Ext, is a library that would replace jQuery, but is also an MVC library that contains a ton of pre-built widgets. There are a ton to choose from - a very good thing.



回答6:

current version of backbone.js seems to work with zepto.js library

it's a lightweight alternative to jquery (it's less that a quarter jquery's size)