i have a page a.html in which i create and iframe with src=b.html and b.html contains another iframe with c.html and c.html contains another iframe with d.html which calls a javascript x.js which should retrieve the url of a.html

all the pages r from diffrent domains

it works fine when i have the js called from c.html but as soon as i add 1 or more pages in iframe i get a permission denied error

im using top.location.href