...

View Full Version : PASSING Variable into IFRAME call...HOW, arghhh...



BrightNail
12-15-2005, 08:30 PM
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??

ralph l mayo
12-16-2005, 04:02 AM
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:


document.getElementById('IframeID').contentDocument.body.style.background = document.body.style.background;

cameronlanni
12-17-2005, 08:10 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum