请解释[0]在此代码: $(function(){
var $cont = $('#cont');
var $el = $cont.children(':first'), el = $el[0];
});
我尝试了一些“警报”查找的文字,但我真的不明白,为什么我们精确的指标,而我们已经知道,我们”重新指向div的“第一个”孩子......?
我想在Mongoid上设置一个版本控制系统。我运行到这个问题,当父对象被保存未保存的新的嵌入式版本的对象: class Version
include Mongoid::Document
embedded_in :memorable, :polymorphic => true
field :version_number, :type => Integer
end