[Project_owners] Menu sorting problem on OS X

James R. Skinner james at istop.com
Tue Feb 7 12:40:17 EST 2006

I use the following piece of code to produce a sorted menu.  It works fine
on Windows machines but on OS X it results in only one item showing up in
the menu.  Anyone have any ideas what the trouble might be?

Thanks, -James

// outer loop begin
var added=false;
var numMenuItems = menu.childNodes.length; 

for(var i=0; i<numMenuItems; i++) {
    if(name.toLowerCase() < menu.childNodes.item(i).label.toLowerCase())
        menu.insertBefore(tempItem, menu.childNodes.item(i));
if (!added) menu.appendChild(tempItem);
// outer loop end

More information about the Project_owners mailing list