我如何從該腳本中獲取腳本文件名?我很確定答案是否定的,但我想我還是會問。如果我的站點引用了一個名為“whatever.js”的腳本,是否可以從該腳本中獲取“whatever.js”?喜歡:var scriptName = ???if (typeof jQuery !== "function") {
throw new Error(
"jQuery's script needs to be loaded before " +
scriptName + ". Check the <script> tag order.");}可能比依賴檢查更值得麻煩,但是到底是怎么回事。
我如何從該腳本中獲取腳本文件名?
元芳怎么了
2019-08-19 17:27:58