Pass URL Variable From Parent Window To Inner Child IFRAME

Discussion in 'JavaScript' started by timallard, Dec 10, 2008.

  1. #1
    Hello,

    Im trying to pass a variable from a parent window to a child iframe. ex:
    http://www.website.com/index.html?variable=value

    I want my iframe within that same page to recognize the variable and give me the value.

    I can not edit the parent document so everything will need to be done from the iframe that lives in it.

    I own both domains, just 1 is content managed and nothing can be changed at this point.

    Any thoughts?

    Thanks!
     
    timallard, Dec 10, 2008 IP
  2. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hello,

    I tried simple test, which works fine. Not sure if it solve your problem. I made top.html with <iframe src="a.html" and inside a.html there's another <iframe src="b.html". So when you open a.html iframe from the top.html page, in your inner child iframe (b.html) you can get the whole URL call through - window.parent.location. Then it's just parsing the query string...
     
    lp1051, Dec 12, 2008 IP