IE error : “Invalid Property Value”

IE invalid Property Value Exception

IE Errors

I got this “invalid property value” error every time I clicked on the tab that
had an Ajax call. Exception was coming from line 1932 character 8.

My first thought was that it is some styling issue and it had something to do with css float property.

While researching I found this quick fix. I decided to share it with you guys. Check out Tim’s post for more information.
I made the changed and the error is gone.

Thanks to Tim.

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]);
}

//CHANGED CODE *************************
else if (Prototype.Browser.IE && property ==
‘backgroundColor’) {
try{
elementStyle[property] = styles[property];
}
catch(err){null}
}
//******************************

else{
elementStyle[(property == ‘float’ || property == ‘cssFloat’) ?
(Object.isUndefined(elementStyle.styleFloat) ? ‘cssFloat’ : ‘styleFloat’) :
property] = styles[property];
}

return element; },

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s