Go Back   CodingForums.com > :: Client side development > JavaScript programming > Post a JavaScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-23-2003, 12:23 AM   PM User | #1
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Making DOM lists behave more like Arrays

Primary intention would be sorting. Ultimately, in-place modification of the list requires setters for the items in it. A NodeList doesn't have setters, but an HTMLOptionsCollection does.

An example of this is here:
http://www.jasonkarldavis.com/select.xhtml

Notice the issues associating with shifting and unshifting. I have a few theories on why it can pop and push but not shift and unshift, but nothing I feel comfortable putting my voice behind yet.

Gecko-only, btw. As always. Just some food for thought mainly.

Implications of this:
  • Anything that provides Array index-like accessors can use Array methods
  • But only collections with setters on individual items can be modified in place (sorting, popping, etc)
__________________
jasonkarldavis.com

Last edited by jkd; 06-23-2003 at 03:14 AM..
jkd is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:18 PM.


Advertisement
Log in to turn off these ads.