insertAtIndex is a method to allow easy addition of an element to the DOM in a very specific location. Much like the other DOM methods I have it is not inserting an html string but an actual element created with document.createElement.
For example... lets say I have a ul with 10 li elements. I want to insert a newly created li after the 7th. I could just say:
$('ulId').insertAtIndex(newLi, 7);
Just nice to have that all wrapped up for an easy one-liner. At least for me it has been.
Brandon
On 8/31/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
I don't mean to beat a dead horse ... thanks for the pointers on those eqivalents ... but I'm more curious about eqivalents to the Enumerable, Array, Range, Hash, String, Forms etc... Not that I use all of that anyways. Typically I only find myself using about 5% of all that extra baggage. I generally use each and find the most. I can really see how a set of officially supported plugins for String manipulation and Forms and such will come in handy. I usually just dig through the source myself to find these answers and I think that will be best. Perhaps I'll throw some documentation for myself and others on my findings.
Thanks for the quick responses. I'm actually on vacation right now and my wife is giving me the evil eye ... so back to my vacation I go. :)
BrandonOn 8/31/06, John Resig <[EMAIL PROTECTED]> wrote:> Back to jQuery ... how many equivalents does jQuery have to prototype?
> removeChildren
.empty()
> insertAfter
.after()
> insertAtIndex,
I'm not sure what this is?
> prependChild
.prepend()
> getParentsByTagName
.parents("tag")
> getParentByTagName
.parent("tag")
> getChildrenByTagName,
.find("tag")
> getChildByTagName
.children("tag")
(tag optional for next and prev)
> getNextSibling
.next("tag")
> getPreviousSibling
.prev("tag")
> setClassName
.addClass()
> Can/Will plugins easily benefit from the build system
> that jQuery currently has, including documentation?
Yes, that's one of the things we're working on - getting the build
system to auto-generate documentation and test cases for plugins too.
--John
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
