Created
October 27, 2014 07:23
-
-
Save think2011/ab5d585a570f86ab0161 to your computer and use it in GitHub Desktop.
获取当前js文件的路径,需要写在文件顶部。
This file contains hidden or 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