Created
January 26, 2011 08:30
-
-
Save walm/796422 to your computer and use it in GitHub Desktop.
Get path from a js script based on name
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
function getScriptPath ( scriptName ) { | |
$('script').each(function () { | |
var src = $(this).attr('src'); | |
if (typeof src == 'string' && | |
src.indexOf(scriptName) != -1) | |
return src; | |
}); | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment