I have a bit of a problem here, and I donβt even know if it is possible at all, here is my dilemma:
I have this script code:
<script id='script1' src='http://link.to.js'></script>
When using firebug, I can clearly see that the script is loaded bee between these tags, like this
<script id='script1' src='http://link.to.js'> function something(){ alert('hi');} </script>
What I want to do, with another script, get the content between these tags, something like
var x = document.getElementById('script1').innerHtml; document.getElementById('somedividhere').innerHtml = x;
This works fine WHEN the code is already part of html, and not when it is loaded from src.
I searched for this for several hours and I did not find any hint, hope someone can help me with this.
source share