Click to See Complete Forum and Search --> : Script With In Script


a_krishnam_raju
03-29-2006, 10:33 AM
Hi
Please go through the code below.

test.html
-----------------------------------------------------------------------
<html>
<head>
<SCRIPT language=JavaScript>

function transferview(image,iname,webaddress) {


info="<TITLE>"+iname+"</TITLE><body topmargin='0' leftmargin='0' rightmargin='0' bottommargin='0' bgcolor='#CEDDFF'><table width='498'; height='500' cellpadding='2' cellspacing='2' bgcolor='#CEDDFF'>" +
" <tr>" +
" <td colspan='2' align='center' valign='middle'><IMG SRC='"+image+"' BORDER=0 /></td>" +
" </tr>" +
" <tr>" +
" <td width='243' height='22' align='center' bgcolor='#FFB7B9'><font face='verdana, arial' size='2' color='#000066'>"+iname+"</font></td>" +
" <td width='243' height='22' align='center' bgcolor='#FFB7B9'><form method='post' action='"+webaddress+"'><input type='submit' value='Request open yahoo in parent window' /></form>" +
" </td>" +
" </tr>" +
"</table></body>"

ImageWindow=window.open("", "newwin","toolbar=no,scrollbars=no, width=500, height=500");
ImageWindow.document.write(info)
ImageWindow.document.close()
}
</SCRIPT>
</head>
<body>
<a href="#" onclick="javascript:transferview('test.jpg','Click the button to open yahoo', 'http://www.yahoo.com')">Henley Wedding Invitation</a>
</body>
</html>

--------------------------------------------------------------------------



What it actually does is:

when i click on the text link in the parent window, it pops up a child window with a button ( and an image).

What i want now is, if i click the button in pop up window, it should open the specified URL in the Parent window (which is at the back) and the pop up window should close.

Please help me, i tried , tried , tried and now tired.

Please advise.

Thank you
Krishnam

EricW
03-29-2006, 11:24 AM
in the popup you can access a function on the main page that would launch the link...

<form onsubmit="window.opener.LAUNCHIT(URL); window.close();return false;">

good luck!

TheBearMay
03-29-2006, 11:24 AM
Please don't cross post:
http://www.webdeveloper.com/forum/showthread.php?t=101046