deSVG is a js library to remove inline SVG bloat from your HTML document. deSVG takes the <img /> tags you supply. It then grabs, using AJAX, the raw SVG you’ve set in the src attribute and replaces that <img /> with the <svg /> it downloads.
Ajax Core Java Script SVG Tutorial