Skip to content

Instantly share code, notes, and snippets.

@siddarth
Created November 26, 2012 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siddarth/4151329 to your computer and use it in GitHub Desktop.
Save siddarth/4151329 to your computer and use it in GitHub Desktop.
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