I have a similar problem like posted here but instead of obtain the parent id, how Can I get a reference to the script parent without having to code an id for the script tag?
For example, I have the following code injected to a website:
<div>
some other html tags
<script src=http://path_to_my_script.js></script>
</div>
What I need is that in my path_to_my_script.js
file I can get a reference to the outer div
.
There is a catch and is that the code will be copied&pasted in several places in the same webpage, which makes an identifier useless.
There is any chance to do that without to code an id in the entire code?
If the solution is with jQuery the better :D
Thanks in advance.