Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts

    PASSING Variable into IFRAME call...HOW, arghhh...

    Here is the deal.

    I have an iframe....

    <iframe src="somepage.html?var="tom";vartwo="jane";varthree="peter"">

    Now....that is all great...BUT, I need to pass another variable INTO the iframe like the others (var, vartwo, varthree) and I won't have that variable UNTIL I do some javascript function to extract a background color from a div tag. Basically, I have to pass a bgcolor into the iframe so the resulting page will then display itself with a color that matches the parent page. Its a backend process....basically, the backend app needs "backcolor=" appended to the iframe.....BUT the iframe is loading first...so how do I do this????

    Do I first extract the data I need, THEN write out the IFRAME call? please advise??

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    Quote Originally Posted by BrightNail
    Basically, I have to pass a bgcolor into the iframe so the resulting page will then display itself with a color that matches the parent page. Its a backend process....basically, the backend app needs "backcolor=" appended to the iframe.....BUT the iframe is loading first...so how do I do this????
    Rather than passing a variable how about giving the iframe an id and using something like:
    Code:
    document.getElementById('IframeID').contentDocument.body.style.background = document.body.style.background;

  • #3
    New Coder
    Join Date
    Oct 2005
    Location
    Camino, California.
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Personally, I think the easiest way to handle this would be to create what I call a bank, which is simply hidden HTML from(s) that store a variable and are then pulled by other framesm pages, or windows. If you don't know how to do this, re-post.
    Currently designing and coding an entire RPG in VB


  •  

    Posting Permissions

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