Forum Moderators: open

Message Too Old, No Replies

Parent to Child Window

         

sfast

8:12 pm on Jun 12, 2007 (gmt 0)

10+ Year Member



I am stuck on javascript code.
Can somebody please help me finding the error.
I am trying to open a child window from a parent window. I have to send data using query string to child window. But before I reach there, I am stuck on thsi small part.

<script language=javascript>
function openWind(windlocation, windheight, windwidth,
windtop, windleft){
var windposition='width='+windwidth+',height='+windheight+',top='+windtop+',left='+windleft;

var NewWindow = window.open(windlocation,'wind',windposition);
if (NewWindow.focus!=null){
NewWindow.focus();
}
}
</script>

</head>

<body>

<a href="same.php" onclick= "openWind("childWind.php",400,410,.5*(screen.height-400),.5*(screen.width-410))" > Link </a>

</body>

sfast

8:36 pm on Jun 12, 2007 (gmt 0)

10+ Year Member



Looks like it is the problem with - passing the parameters to the function...Is it?

<a href ="javascript:void(0);" onclick= "openWind(""childWind.html",400,410, ))" > Link </a>' ;

My fault - I changed the value of href = ="javascript:void(0);"

sfast

3:48 am on Jun 13, 2007 (gmt 0)

10+ Year Member



Somebody please help me here
I tried to google ... but I got all kind of information except the exact way to pass querystring.

Is there any proper way to pass querystring from parent to child window in php?

colandy

7:41 am on Jun 13, 2007 (gmt 0)

10+ Year Member



1. Use single quotes around childwind.php.

sfast

2:49 pm on Jun 13, 2007 (gmt 0)

10+ Year Member



echo "<a href ='javascript:void(0);' onclick= 'openWind('something.html', 400, 400)' > Link </a>" ;

I changed it to the above way but still no child window opens up.

Trace

7:07 pm on Jun 13, 2007 (gmt 0)

10+ Year Member



Try this

echo "<a href =\"javascript:void(0);\" onclick= \"openWind('something.html', 400, 400)\" > Link </a>" ;

sfast

7:26 pm on Jun 13, 2007 (gmt 0)

10+ Year Member



Wow it opened.
Thankyou so much.