Skip to content

Instantly share code, notes, and snippets.

@think2011
Created October 27, 2014 07:23
Embed
What would you like to do?
获取当前js文件的路径,需要写在文件顶部。
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