Skip to main content

Bug Tracker

Side navigation

#3923 closed bug (invalid)

Opened January 20, 2009 12:00PM UTC

Closed January 22, 2009 02:42AM UTC

Last modified November 19, 2010 10:02AM UTC

.css('background-image') returns different result for in ie and the others

Reported by: blinds Owned by:
Priority: minor Milestone: 1.3.1
Component: core Version: 1.3
Keywords: css background-image ie7 quotation marks Cc:
Blocked by: Blocking:

.css('background-image') returns:

url(host/folder/file) in ff3.1


url("host/folder/file") in IE (note: the quotation marks!)

not testet in other browsers.

this code worked for me as a temporary fix:

function getBackgroundImageUrl(el) {

var url = $(el).css('background-image').split('(')[1].split(')')[0];

var url = $.browser.msie ? url.split('"')[1].split('"')[0] : url;

return url;


Attachments (0)
Change History (3)

Changed January 22, 2009 12:46AM UTC by dz comment:1

Aren't the two functionally identical?

Changed January 22, 2009 02:42AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

See the W3C:

Quoting is allowed, and either quoting or escaping is required if there are certain characters in the URL. So, your code will need to be prepared for it anyway.

Changed November 19, 2010 10:02AM UTC by snover comment:3

#7564 is a duplicate of this ticket.