Item, Javascript and IE6
Posted by Sandro Paganotti in
comments are closed
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.

