I'm attempting to dynamically insert some svg into a prince document. The svg is generated using svgtex which extracts the MathJax svg rendering of a Tex expression using PhantomJS. If I simply insert an img tag with the appropriate src, I get the displayed svg; however, the scaling becomes a problem and it doesn't work correctly unless I set a specific width and height on the element. If however I copy the svg code from the generated file, and copy/paste it inline it works fine and the scale is perfect.
As a result, I'm attempting to load and insert the svg dynamically with javascript. Ajax looks to be unsupported, so I switched to injecting an iframe like so:
This all works fine, but what I need to do is be notified when the iframe loads so that I can extract the contents and insert it elsewhere in the document. I don't seem to be able to capture the load event for an iframe. Is that the case?
Any other ideas are welcome too.
Thanks!
As a result, I'm attempting to load and insert the svg dynamically with javascript. Ajax looks to be unsupported, so I switched to injecting an iframe like so:
<iframe src="http://localhost/eqn?2^n" />
This all works fine, but what I need to do is be notified when the iframe loads so that I can extract the contents and insert it elsewhere in the document. I don't seem to be able to capture the load event for an iframe. Is that the case?
Any other ideas are welcome too.
Thanks!