Created
November 26, 2012 23:25
-
-
Save siddarth/4151329 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 find(what, current) { | |
var ret; | |
if (!current) { | |
current = window.top; | |
} | |
for (var i=0; i < current.frames.length;i++) { | |
if (current.frames[i].name == what){ | |
return current.frames[i]; | |
} | |
ret = find(what,current.frames[i]); | |
if (ret) { | |
return ret; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment