Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#3923 closed bug (invalid)

.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;


Change History (3)

comment:1 Changed 8 years ago by dz

Aren't the two functionally identical?

comment:2 Changed 8 years ago by dmethvin

  • Resolution set to invalid
  • Status changed from new to closed

See the W3C: http://www.w3.org/TR/CSS21/syndata.html#uri

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.

comment:3 Changed 6 years ago by snover

#7564 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.