#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: |
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 (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → 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.
Note: See
TracTickets for help on using
tickets.
Aren't the two functionally identical?