On Fri, Jan 22, 2010 at 12:16 PM, Viet Nguyen <[email protected]>wrote:

> Hi,
>
> Just a minor javascript cross-browser hack.
>
> When adding an options to a select tag using javascript, I can see in DHIS
> you are doing like this :
>
>  optionComboSelector.add( option, null );
>
> This will only work on gecko-based browsers. For IE ( tested with IE 8  & 7
> ) it will throw error ,  the right one should be like this :
>
>  optionComboSelector.add( option ); // only one param
>
> So the solution should be :
>
>    try {
>         optionComboSelector.add( option, null );  // for gecko-based
> browser...not tested with other webkit-based browsers ...
>     }catch(e){
>         optionComboSelector.add(option);  // just for IE
>     }
>
> A common method in common.js should be useful.
>
> Regards,
>



OK thanks for pointing this out. There might be a centralised method for
this in commons.js or lists.js. Is this already taken care of in jQuery, if
so could we use that instead?
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to