View Full Version : what the? calling a function in a frame.. should be simple?

07-07-2006, 11:20 PM
Okay, this is extremely odd, I think... I had this working perfectly a week ago or so, and then suddenly, it no longer works! I haven't touched the page at all!

It's located at www.hollywoodlightweights.com

the issue is this: i have a function on the main page that you can use to change the color scheme of the site. There's a few iframes that I copied and pasted the function onto and added top.framename.functionname() to the function on the main page, so that when it's called, it will change the color of the frames as well, it worked perfectly!

Now for some reason, it no longer works.. I put a test button (a link that says asdf) on the frame itself, to make sure the function works, and it does, when called from within the frame, but for some reason I can't get it to call from the parent frame. I've tried calling it by id: document.getElementById('iframeid').contentWindow.function();
and by name with top.frames['my-iframe'].function() and top.framename.function() - nothing is working!

thanks in advance...

07-07-2006, 11:29 PM
Okay, here's something I figured out...

if you go to www.hollywoodlightweights.com - the function (the little colored squares) WORKS. however:
if you go to hollywoodlightweights.com (without the www.) it doesn't work!

I assume this has something to do with the top.framename.function needing a www. for the top part to work or..?? I have no idea... can anyone shed some light on this?

07-10-2006, 12:39 AM
I see the little colored squares both ways......

07-10-2006, 12:59 AM
you see them both ways sure... i meant the function they call doesn't work without the www.

click on one of them and you'll see... with the www. all the elements change color when you click them, without it the items in the iframe don't change color.

(you have to click the bird to actually enter the page and see what im talking about)

07-10-2006, 07:55 AM
ok, i did as you said. and when i open the page with the www. i can click on the colored squares and the backgroud of the frame or iframe changes to that color. and it looks like the partial backgroud of the center image changes as well. when i go to the page without the www. the background still changes but the part of the center image that did change doesnt. is that the problem?

i noticed that you are displaying a div or layer from the main page over the frame page. the links on there bleed over into the main page and i cannot read what part of them say.

and although icannot prove this to work atm. try using a script to detect what the windows location is. if it is the www. version do nothing (return) else set the windows location to http://www.yoursite.com.

<script type=text/javascript>
var loc=window.location;



again icannot test this cuz i do not host my own website, i do it through a compnay and any way you access my site it is automatically set to h t t p://www.angelfire.com/mysite

07-10-2006, 08:30 AM
yes, that is the problem.. exactly.

and yes, there is a layer over part of the iframe, on purpose, it was the only way i could get the middle block of the page to be 100% of the remaining height (minus the header and footer divisions) no matter what the users screen size.

i'm not sure what you mean by using a script to determine the windows location, what will that do exactly?

i'll give it a try...