jquery - Insert contents of a .SVG file into an HTML element -


i have svg element in file my_ui_element.svg. want insert svg html element in index.html. how can this?

html before insert:

<div class="container">   <!-- insert svg here --> </div> 

html after insert:

<div class="container">   <svg>...</svg> </div> 

note: using <img src="my_ui_element.svg"> not acceptable answer since not add svg element dom.

this turned out trivial. svg file valid html.

here jquery answer:

$('.container').load('my_ui_element.svg');


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -