title: Reload DOM after changes
body: <p>I have a small problem with SVG in an embed tag. I update the source of an embed tag with an SVG file path with javascript. Then I have to update the viewbox attribute to resize correctly the SVG.</p>
  
  <p>The problem is that the SVG tag is not available because the javascript execution is too fast.</p>
  
  <p><strong>An example :</strong></p>
  
  <pre><code>//Creation and insertion by JQuery
  var EmbedTag = $("&lt;embed id='zoomSVG' src=idSVG + ".svg' type='image/svg+xml' width='500px' height='500px' /&gt;").appendTo(zoomGalleryHisto);
  
  //This doesn't work : svgDoc is null
  //SVG document recovery
  var svgDoc = document.getElementById('zoomSVG').getSVGDocument();
  
  This work :
  setTimeout(function(){
     //SVG document recovery
     var svgDoc = document.getElementById('zoomSVG').getSVGDocument();
  },100);
  </code></pre>
  
  <p>I would like to not use the setTimeout function because the timeout value depend on hardware. Sometimes 100 ms works fine but I have to find an universal solution.</p>
  
  <p>After embed tag insertion, could I reload the DOM by javascript ? Is an existing event for embed tag when the load of the embedded object is done ?</p>
  
  <p>Thanks for your help</p>