I have a rather complicated part of Javascript that works flawlessly without errors in Google Chrome, Firefox, Safari and Opera. However, as always, this is an infinitely annoying case; it completely fails in Internet Explorer. I tested in IE7 and IE8 and got the same error:
Invalid argument. prototype.js, line 2216, character 9
I am using Prototype 1.6.1 hosted via Google. The indicated error does not help much since it does not tell me where the error occurs in my actual code. The line mentioned in the error is the 6th line from below in the following code:
setStyle: function(element, styles) {
element = $(element);
var elementStyle = element.style, match;
if (Object.isString(styles)) {
element.style.cssText += ';' + styles;
return styles.include('opacity') ?
element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
}
for (var property in styles)
if (property == 'opacity') element.setOpacity(styles[property]);
else
elementStyle[(property == 'float' || property == 'cssFloat') ?
(Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
property] = styles[property];
return element;
},
setStyle , , , . , setStyle 100 script , . -, , , ?