Today I noticed a small compatibility issue with jQuery on Google Chrome.
When running on Chrome jQuery returns certain CSS properties differently …
After some cross-browser testing I found out that jQuery returns the .css(‘background-image’)
property with quotes on FireFox / Internet Explorer – but without quotes on Chrome.
Just For example, in order to retrieve the URL of a CSS background image:
if(!jQuery.browser.webkit){
bg = jQuery('div#image01')
.css('background-image')
.replace('url("','')
.replace('")','');
}
else {
bg = jQuery('div#image01')
.css('background-image')
.replace('url(','')
.replace(')','');
}
This might affect other CSS properties as well – I just have faced this one difference until now.
