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 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    262
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Function call in iframe

    I have done some searching and I thought I understood how to do this but obviously I am still doing something wrong.

    My parent window has an iframe named 'myframe';

    in my iframe I have a function that looks like so
    Code:
    function SetLargeImage(SRC)
    {
    var idsplit=SRC.split(/_/);
    var imageid=idsplit[1];
    //alert(imageid);
    parent.document.getElementById('M_1').src='http://www.photogap.net/".$_SESSION["NickName"]."/gallery/medium/M_'+imageid+'.jpg';
    
    }
    I need to call this function in the parent window onload so it shows the first image automatically when the page loads for the first time.

    So I set the var for the imageid in php above this code here

    Code:
    <script type=\"text/javascript\">
    window.frames.myframe.SetLargeImage('T_".$_GET["imageid"]."'));
    </script>
    I have alerted the T_".$_GET["imageid"] and it shows what it is supposed to but my function call is not taking the parameter and splitting it and setting the img src = to the result. So I assume the function call is not even happening at all.

    So any ideas on what I am doing incorrectly here?

    Thank you for any help provided.

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you link a sample of the problem?

    david_kw


  •  

    Posting Permissions

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