Created
June 23, 2011 19:35
-
-
Save chucktrukk/1043428 to your computer and use it in GitHub Desktop.
find the URL for this script's absolute path and set as the resourceFolderName.
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
var resourcesFolderName = "my/folder/here"; | |
var documentName = "name-of-doc"; | |
var documentLoaderFilename = "this-script-name.js"; | |
// find the URL for this script's absolute path and set as the resourceFolderName | |
try { | |
var scripts = document.getElementsByTagName('script'); | |
for(var i = 0; i < scripts.length; i++) { | |
var scriptSrc = scripts[i].src; | |
if(scriptSrc != null && scriptSrc.indexOf(documentLoaderFilename) != -1) { | |
resourcesFolderName = scriptSrc.substr(0, scriptSrc.lastIndexOf("/")); | |
break; | |
} | |
} | |
} catch(err) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment