tripwater
01-15-2007, 03:17 PM
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
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
<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.
My parent window has an iframe named 'myframe';
in my iframe I have a function that looks like so
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
<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.