What is the correct thing to do here?

The simple thing would be to return null if o[index] is not a valid
option.

Test choices:
if index < 0 || index >= o.length
o[index] === undefined



Error: o[index] has no properties
Source File: dynapi3x/src/gui/htmllistbox.js
Line: 99

96 p.getItem = function(index){
97      if(this.getElm()) {
98              var o = this.elm.options;
99              if(typeof(index)=='number') return 
{text:o[index].text,value:o[index].value};
                else {
                        for(var i=0;i<o.length;i++) if(index==o[i].value) return {
                                text:o[i].text,
                                value:o[i].value
                        }
                }
        }               
};


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to