javascript文件如何知道它位于何处?例如:
<script type="text/javascript" src="http://mysite.com/scripts/howdy.js"></script>
Run Code Online (Sandbox Code Playgroud)
如何howdy.js知道代码http://mysite.com/scripts/howdy.js?
编辑:澄清.我不能依赖于在DOM中搜索我的脚本标记,因为我需要在DOM准备好之前了解它.
javascript ×1