Skip to content

Instantly share code, notes, and snippets.

@siddarth
Created November 26, 2012 23:25
Show Gist options
  • 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