Posted By

Alexintosh on 10/28/11


Tagged

get iframe Parent


Versions (?)

Ifram get parent


 / Published in: JavaScript
 

URL: www.tecnocrazia.com

  1. function get_root(obj, current_ref) {
  2. if(obj.parent.location.href != current_ref) {
  3. return get_root(obj.parent, obj.location.href);
  4. }
  5. else {
  6. return obj;
  7. }
  8. }
  9.  
  10. Usage: get_root(window, window.location.href).location.href

Report this snippet  

You need to login to post a comment.