in following code, empty jquery selector $()
mean? mean $(document)
?
var menu = { setting:{ issimpledata:true, treenodekey:"mid", treenodeparentkey:"pid", showline:true, root:{ isroot:true, nodes:[] } } , loadmenutree:function(){ $("#menutree").ztree(menu.setting, privilegedate); } }; $().ready(function(){ menu.loadmenutree(); });
does mean
$(document)
?
no, means empty jquery collection, $.fn.ready
doesn’t care what’s in jquery collection:
> $().length 0 > $.fn.ready function (a){return n.ready.promise().done(a),this}
note how doesn’t make use of this
except return chaining. use $(document).ready
, $().ready
, $('body').ready
, $('blink').ready
… non-deprecated way passing listener jquery function itself:
$(function () { menu.loadmenutree(); });
Comments
Post a Comment