@Gabriel: unquoted keywords can be a problem in IE for certain
reserved words (eg 'class'), but in general it's fine to leave them
unquoted, and I've never seen a problem from this in firefox. So I
don't think your advice is likely to be helpful in this case.

@cyiam: Be aware that 'innerHTML' is not part of the W3C standard. IE
introduced it, and Firefox then implemented it, but there is no
guarantee that Firefox will always give the same result.

You could look at it in Firebug and try to see what's happening, but
why not use Prototype's 'update' instead:

var newOption = new Element('option',
{value:item.id}).update(item.nm);


Colin


On Oct 31, 12:35 am, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> Well, first of all, try quoting your hash keys like this:
> list.each(function(item){
>                        var newOption = new Element('option',
> {'innerHTML':item.nm,'value':item.id});
>                        selectList.insert({bottom:newOption});
>                });
>
> If it still doesn't work, try using firebug's[1] console and debug to see
> any exception the script might be throwing.
>
> [1]www.getfirebug.com
>
> Gabriel Gilini
>
> www.usosim.com.br
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> On Thu, Oct 30, 2008 at 5:30 PM, cyiam <[EMAIL PROTECTED]> wrote:
>
> > HELP! This is the first time I have my script working for IE but not
> > for Firefox.
> > I have a 3 drop downs. The first dropdown dictates what will be shown
> > on the second. And second drop down dictates the third. I use
> > Ajax.Request() to get the drop down values from database. onSuccess, I
> > call the function below:
>
> > function updateList2(list){
> >        var selectList = $('list2');
> >        selectList.update();
>
> >        var newOption = new Element('option',{innerHTML:'-- Select One
> > --',value:''});
> >        selectList.insert({bottom:newOption});
> >        if (list){
> >                list.each(function(item){
> >                        var newOption = new Element('option',
> > {innerHTML:item.nm,value:item.id});
> >                        selectList.insert({bottom:newOption});
> >                });
> >        }
> > }
>
> > Works fine in IE, but when Firefox will not insert the new options
> > into the list!
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to