Hi
I have a <script>
where it adds to the <head>
another script.
This new script is supposed to find the original <script>
that inserted it.
can I put <script id="blablabla">
and let the new <script>
find it?
<div id="placeholder-1"></div>
<script type="text/javascript">
<//![CDATA[
(function() {
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "blablabla.com/blabla.js";
(document.getElementsByTagName("head")[0] ||
document.getElementsByTagName("body")[0]).appendChild(s);
})();//]]></script>
Now, the blabla.js needs to find the div placeholder. I am trying to save that div placeholder, by giving it's id already to the script.
is that a browser compatible?
thanks