Ticket #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: | |
| 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:2 Changed 4 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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Aren't the two functionally identical?