jquery - How can I find the <script> element where my JavaScript is declared? -
for fragment of html/javascript gets loaded host web page dynamically, need javascript fragment know declared. there way of finding tag executing javascript loaded from?
the html fragment loaded same host current page using jquery ajax call , inserting result dom.
edit:
what trying do, , above 1 potential way of implementing it, have fragment of html/javascript being loaded dynamically , known initialization function called host page parameters. portable solution allow worlds meet solve problem.
you may use id attribute script tag , find #mylib
selector or find using tag&attr selector script[src="mylib.js"]
.
Comments
Post a Comment