[tw] Re: manipulating the dom using jQuery

2009-11-10 Thread jk
I understand what's happening but what I want to know is why. Because I expect it work one way, and it works another. Therefore, if I can understand the underlying concept, I won't assume a logical conclusion that is incompatible with javascript (because there is surely a difference in mental

[tw] Re: manipulating the dom using jQuery

2009-10-30 Thread FND
May I suggest you moved on and consider [using jQuery] I believe one should have a firm grasp of JavaScript and the DOM before using abstractions like jQuery. (Although that's not necessarily a strictly linear progression; experimenting with jQuery can be educational WRT the underlying

[tw] Re: manipulating the dom using jQuery

2009-10-30 Thread shavinder
Wow FND! I could have never guessed. Thanks! Its here too at https://developer.mozilla.org/En/DOM/Node.appendChild: var appendedElement = element.appendChild(child); The returned element is the child which is *appended*. So this line does NOT return element p, it returns the helloworld

[tw] Re: manipulating the dom using jQuery

2009-10-30 Thread FND
Is the element p being created? I would hazard a guess that it *is* being created. But in the following line the element p is not appended to the body but is left orphan It is being created in-memory, but does not persist in the document. Thus the object's memory will be deallocated (freed)