Ruby On Rails, Design, Simplicity, Web 2.0, Ajax, Mac and Tons of Pizza.

Nov 19

Item, Javascript and IE6

Posted by Sandro Paganotti in comments are closed digg this add to delicious

Yesterday I wrote a few lines of Javascript code with the aim to apply a Fade Effect on an item passed as parameter; this is a summary of what I created:


function FadeItem(context,item_nr,afterfinish){
    item = $(context + "_" + item_nr);
    Effect.Fade(item,{
        afterFinish: function(){ afterfinish.apply(); }
    }); 
}

While trying this simple function I found no problems under Firefox and Safari. Things changed when I switched to Internet Explorer 6, triggering the function made no effect at all: plus any error was displayed. The only solution I found to identify the bug was cut one by one the lines of the function until I got it work.

What was wrong with my function ?

‘item’ in Internet Explore 6 seems to be a reserved word.

Hope this could help you while choosing the name for your variables.

Sandro.

Post a comment

Categories:

Tags:

Powered by Mephisto, Valid XHTML 1.1, Valid CSS - Supported by Wave Factory