how can an iframe get url of main page code example
Example: get top window url from iframe
var url = (window.location != window.parent.location)
? document.referrer
: document.location.href;
var url = (window.location != window.parent.location)
? document.referrer
: document.location.href;