I have a plugin from a supplier, which i can only include in my website like this:
<p>my content</p>
<script type="text/javascript" src="http://widgeturl"></script>
<script type='text/javascript'>
showWidget();
</script>
<!--widget inserts lots of HTML here -->
<p>more of my content</p>
Now, the HTML that this script generates is pretty ugly and i would like to attach an event handler to some event that notifies me when the widget script has done it’s work and i can start grabbing/modifying the HTML that it has generated.
Can anyone explain how i would do this? Thanks!
If
showWidget()is blocking (which it seems to be since it’s inserting HTML directly after its own script), you can just put another<script>tag underneath it and do stuff with the HTML preceding it.