Created
January 19, 2010 18:10
-
-
Save tfluehr/281135 to your computer and use it in GitHub Desktop.
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
function getObject(parts) | |
{ | |
if (typeof(parts) == 'string') | |
parts = parts.split('.'); | |
var obj = window; | |
for (var i = 0, p; obj && (p = parts[i]); i++) | |
{ | |
obj = (p in obj ? obj[p] : undefined); | |
} | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment