可能重複:
How may I reference the script tag that loaded the currently-executing script?獲取當前腳本標籤
我wan't實現這個配置選項在腳本中絲毫這種形式
<script src="x.js" attr1="val1" attr2="val2" attr3="val3"></script>
問題找到當前腳本標記,並且x.js可以在varius路徑中fold1/x.js
fold1/fold2/x.js
../fold/x.js
etc ... 我認爲這是可能的,因爲Dojo框架使用這種方法。
還涉及:http://stackoverflow.com/questions/6779515/can-you-select-the-script-element-that-included-the-javascript – zzzzBov