获取当前js文件的路径,需要写在文件顶部。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
currentJSDir = do -> | |
js = document.scripts[document.scripts.length-1] | |
return js.src.substr 0, js.src.lastIndexOf '/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment