SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting the url of topmost page

    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

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try

    window.top

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ive tried window.top and document.referrer
    but didnt work either
    document.referrer gave the url of its parent iframe and when i wrote x=window.top and x.location it worked exactly like top.location


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •