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 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts

    what the? calling a function in a frame.. should be simple?

    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...
    Last edited by devonrs; 07-07-2006 at 11:27 PM.

  • #2
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?
    Last edited by devonrs; 07-07-2006 at 11:37 PM.

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    ???

    I see the little colored squares both ways......
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #4
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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)

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    ok, i think i see what you're talking about

    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.

    Code:
    <script type=text/javascript>
    var loc=window.location;
    
    if(loc=="http://www.yoursite.com/"){return;}
    else{window.location="http://www.yoursite.com/";}
    
    </script>

    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
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #6
    New Coder
    Join Date
    Feb 2006
    Posts
    44
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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...

    thanks


  •  

    Posting Permissions

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