Skip to content

Instantly share code, notes, and snippets.

@walm
Created January 26, 2011 08:30
Show Gist options
  • Save walm/796422 to your computer and use it in GitHub Desktop.
Save walm/796422 to your computer and use it in GitHub Desktop.
Get path from a js script based on name
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