I'm wondering if there's a way in jQuery to grab some SVG data included in a div on a page and place that data into a CSS background-image
url? I'm trying to do this instead of loading an external SVG file, as I'd like to have a completely self-contained HTML file. I'm trying to do something like this:
var svgData = $("#div-containing-svg").html()
$("other-div").css({backgroundImage:svgData});
Is this possible? And further, would it work across browsers?