I have this code snippet (embedded in an angularjs app) intended to replace the content of an existing div popup.
var scroller = $("#popoverImageViewer .scroller");
var html = "";
for (var i=0; i<c.length; i++) {
var e = c[i];
var content = $(e).html();
var url = $(e).css('background-image').replace(".thumb","").replace("/thumb","/fullsize");
console.log("scope.openPopoverImageViewer ("+p+", "+index+") url = "+url);
var sHtml =
"<div style=\"background-image: "+ url +"\">\n\
<div>\n"
+content
+"</div>\n\
</div>\n";
html += sHtml;
console.log("scope.openPopoverImageViewer ("+p+", "+index+") html = "+sHtml);
}
scroller.html(html);
It works on all platforms except on IE10/Windows 8 which generate folders as attributes as follows:
Any idea why ?
Ok, just realized that IE10 code snippet…
var url = $(e).css('background-image');
returns url in the form of url("that_very_url"} with extraneous double quote, hence the issue afterwards, where IE10 thinks the first double quote closes the style attribute, the remaining of the url generate extraneous attribute.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.