/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_root(obj, current_ref) { if(obj.parent.location.href != current_ref) { return get_root(obj.parent, obj.location.href); } else { return obj; } } Usage: get_root(window, window.location.href).location.href
URL: www.tecnocrazia.com