[thelist] Closing PDF pop-up windows

Ryan Rushton web at ryanrushton.com
Mon Nov 7 13:34:51 CST 2005

I use javascript to open a new window that contains a PDF help file.  I
want to be able to include a link in the parent window that closes this
popup window.  My script works just fine when the popup is an HTML file,
but when I open a PDF in the popup it no longer closes.

Here is the script:

<title>My Parent Window</title>
<script type="text/javascript">
function openHelp(url) {
	helpWin = window.open(url,'help');

function closeHelp() {
	if (helpWin && !helpWin.closed)


<p>Get help with <a href="#" onclick="openHelp('filename.pdf'); return

<p><a href="#" onclick="closeHelp(); return false;">Close help


Does anyone know how to get the window to close?

More information about the thelist mailing list