From: <ml...@id...> - 2003-09-05 04:23:00
|
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 } } } }; |