I am using
var url = (window.location != window.parent.location) ? document.referrer:document.location; to access the domain name of a website from within my iframe. Surprisingly this does the job! But will this work for all cases?
I am using var url = (window.location != window.parent.location) ? document.referrer:document.location; to access the
Share
parent.location works on all browsers : http://www.w3schools.com/jsref/prop_win_parent.asp