load-svg
v1.0.0
Published
load an svg element over xhr
Downloads
50
Maintainers
Readme
load-svg
load an svg element over xhr
example
var loadsvg = require('load-svg');
loadsvg('wizard_hat.svg', function (err, svg) {
document.body.appendChild(svg);
});
methods
var loadsvg = require('load-svg')
loadsvg(opts, cb)
Load an svg asynchronously over xhr and construct the svg dom element.
cb(err, svg)
fires with the svg dom element.
opts
can be a string uri or an option argument that is passed through to the
xhr module.
install
With npm do:
npm install load-svg
license
MIT