Stacey Thornton
unread,Aug 4, 2011, 3:01:43 AM8/4/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to KnockoutJS
Something I couldn't help but notice in the documentation, samples,
examples, etc about KnockoutJS.
We never seem to use the $(document).ready(function(){ // ... }
scheme. Everything is just put inline after the HTML.
I was wondering if there is an implicit reason for this, and if
wrapping our view models in our document header will hurt performance
or cause problems. In javascript heavy pages, knowing when something
will load can be EXTREMELY important, and I fear leaving free-floating
javascript is not the wisest decision to make. Someone feel free to
correct me if I am wrong, but in a typical jQuery page, it would LOAD
like ..
- CSS files
- JS files
- html content
- knockout as encountered
- dom ready
- (document).ready jQuery code
so then what if my dom-ready code has any relationship to my view
Model?
Does JavaScript just not work in this procedural way? Does Knockout
natively understand this idea of waiting for the DOM to be ready? Am I
just an idiot? Will I ever shut up? All these answers and more in your
hopeful replies, lovely community.
(P.S - of any infrastructure support group I've ever participated in,
Knockouts is by far the best. I think we owe a lot of that to RPN and
Ω Alisson and thelinuxlich and such other top contributors. I don't
think you guys get enough credit for what you do)