Bug Tracker

Ticket #3923 (closed bug: invalid)

Opened 6 years ago

Last modified 4 years ago

.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:
Blocking: Blocked by:

Description

.css('background-image') returns:

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

and

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

comment:1 Changed 6 years ago by dz

Aren't the two functionally identical?

comment:2 Changed 6 years ago by dmethvin

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

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 4 years ago by snover

#7564 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.