[KLUG Members] Opening a popup with Java Script

Adam Tauno Williams adam at morrison-ind.com
Tue Jun 21 09:10:06 EDT 2005


DOH! DOH! DOH! DOH! DOH! DOH! DOH! DOH! DOH! DOH! Doh! Doh! Doh! Doh!
Doh! doh! doh! doh. doh.

It appears it was a *(^&R&*#T)@*F)@G quoting problem.

$popUpUrl = sprintf('http://throw/hedera/popup.php?user=%s&company=%
d&question=%d', $_GET['login'], $_GET['objectid'], 1);
echo "<A HREF=\"javascript:void(0)\" onClick=
\"return(window.open('$popUpUrl', 'Hedera: Edit Response',
'widgth=432,height=270,toolbar=0,scrollbars=0'));\">Edit
Response</A><BR>";
echo "<form><input type=button value=\"Edit Response\" onClick=
\"return(window.open('$popUpUrl', 'Hedera: Edit Response',
'widgth=432,height=270,toolbar=0,scrollbars=0'));\"></form>";

Either of the above work.  If you escape the single quotes in the
javascript it doesn't work,  and if you use escaped double quotes it
doesn't work.  Neither does it winge, cry, or complain.

Now to get the child window to tell the parent window to refresh when it
closes and I'm in business.

> >try
> >onClick=return(window.open('yoururl.html'))
> I do roughly the same idea, here is the full <a> tag...
> <a href="http://www.lueckdatasystems.com/Nehemiah/00000015.html" onClick="javascript:window.open('/datacentertour/datacenter.html','EnlargeView','width=503,height=518,scrollbars=0','_blank')">
> I reload the same page with the href tag, the onClick event takes care of opening the new window, and the of course some various options for how the popup window is formatted. This is basically an "onClick splitter" as both the href and the onClick actually happen.
 



More information about the Members mailing list