Tags » Backbone

how backbones get built, a poem

backbones get built
vertebrae by vertebrae
with every victory
with every heartache
with every triumph
with every shattering
with each awakening

they become sturdy
bearing the weight of new consciousness… 106 more words

Self Care

Backbone创建model

Model = Backbone.Model.extend({‘name':’ou’ })

1)  var n = new Model({‘name':’lois’})

2)  var m = new Model({}, {‘name':’lois’})

两个对象有什么区别呢?

m
_changing: false
_observe: function () {  }
_options: null
_pending: false
_previousAttributes: Object
_wasChanging: null
attributes: Object
__proto__: Object
changed: Object
__proto__: Object
cid: "c207"
__proto__: child
… 40 more words
Backbone

Real quick. If you are browsing this here blog and you spot content that is yours that I didn’t cite correctly, let me know. Tell me how to cite it correctly or tag you in it or whatever method you’d prefer, and I’ll do my utmost to keep everything kosher. 118 more words

Backbone

This isn't a joke. I made a plan and everything.

So I started a blog.  No praise there. If anything, the time spent blogging will DRAW from time spent actually getting things done. That said if anyone sees this or checks in, I’d rather them see that I’m actually doing something. 280 more words

Backbone

Backbone 的事件们

Calling save with new attributes will cause a "change" event immediately, a"request" event as the Ajax request begins to go to the server, and a "sync" event after the server has acknowledged the successful change.

34 more words
Backbone

backbone patch属性

savemodel.save(, )
通过委托给Backbone.sync,保存模型到数据库(或替代持久化层)。 如果验证成功,返回jqXHR,否则为 false。 attributes散列(如set)应包含你想改变的属性 – 不涉及的键不会被修改 – 但是,该资源的一个完整表示将被发送到服务器。 至于set,你可能会传递单独的键和值,而不是一个哈希值。 如果模型有一个validate方法,并且验证失败, 该模型将不会被保存。 如果模型

19 more words
Backbone

HTTP协议中PUT和POST使用区别

有的观点认为,应该用POST来创建一个资源,用PUT来更新一个资源;有的观点认为,应该用PUT来创建一个资源,用POST来更新一个资源;还有的观点认为可以用PUT和POST中任何一个来做创建或者更新一个资源。这些观点都只看到了风格,争论起来也只是争论哪种风格更好,其实,用PUT还是POST,不是看这是创建还是更新资源的动作,这不是风格的问题,而是语义的问题。

在HTTP中,PUT被定义为idempotent的方法,POST则不是,这是一个很重要的区别。

“Methods can also have the property of “idempotence” in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request.” 39 more words

Backbone