Trevor
Mon Oct 24 23:59:07 CDT 2005
Russell,
I had a look at this thread today with comments from some experts.
On your site, I found some links with close buttons on them which worked in
IE6, but in Firefox the close button didn't work at all, let alone give a
prompt - it did nothing!! Is that what you found.
I am no expert, but I read here that setting window.opener to 'fred' or
'george' or 'asjhelrir' works only because of a bug in most browsers. But
strangely, this code doesn't work at all in Firefox: <input type="button"
value="Close" onClick="window.opener='fred';window.close()"> ??
Tom suggested these
<a href="javascript:window.close();">Close Window</a>
--or--
<form>
<div align="center"><center><p><input TYPE="button" NAME="close"
VALUE="Close this Window" onClick="self.close()"></p>
</center></div>
</form>
The form button method is the same as what you have, except that the syntax
is correct. (An input button should not be used outside a <form>, and Tom
has corrected this.)
So it is a mystery to me.
One thought I had is:
Why add a "Close" button at all?
Wouldn't it be clear to most that clicking the red "X" in the top right hand
corner will close the pop-up window?
--
Keep trying,
Trevor L.
Website:
http://tandcl.homemail.com.au
Russell wrote:
> love to :
http://www.rozmenton.com/necklaces.html
>
> This one works nicely in IE , but not Firefox or Netscape.
>
> Thanks for looking Thomas,
>
> Russell
>
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
> news:uNhj9TR2FHA.3912@TK2MSFTNGP15.phx.gbl...
>> Can you provide a link to the page that has a link to the popup
>> create and with the close window script?
>>
>> --
>> ==============================================
>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>> ==============================================
>> If you feel your current issue is a results of installing
>> a Service Pack or security update, please contact
>> Microsoft Product Support Services:
>>
http://support.microsoft.com
>> If the problem can be shown to have been caused by a
>> security update, then there is usually no charge for the call.
>> ==============================================
>>
>> "Russell" <xxxxrpp44@optonline.net> wrote in message
> news:OKyiVHQ2FHA.2268@TK2MSFTNGP15.phx.gbl...
>>> HI Thomas,
>>>
>>> I am using Jimco's Java Script Spawn add-in. I have tried various
>>> close buttons in the spawned windows. All result in an alert box
>>> requiring confirmation before closing the window, except the one
>>> from Trevor in this thread. His works in IE but his doesn't work
>>> in Netscape or Firefox. Any suggestions?
>>>
>>> Thanks
>>>
>>> Russell
>>>
>>>
>>>
>>>
>>>
>>> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
>>> news:ul33gfK2FHA.3720@TK2MSFTNGP14.phx.gbl...
>>>> Yes, if you create a popup via JavaScript,
>>>>
>>>> --
>>>> ==============================================
>>>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>>>> ==============================================
>>>> If you feel your current issue is a results of installing
>>>> a Service Pack or security update, please contact
>>>> Microsoft Product Support Services:
>>>>
http://support.microsoft.com
>>>> If the problem can be shown to have been caused by a
>>>> security update, then there is usually no charge for the call.
>>>> ==============================================
>>>>
>>>> "Russell" <xxxxrpp44@optonline.net> wrote in message
>>> news:%23ViB8EK2FHA.2940@TK2MSFTNGP12.phx.gbl...
>>>>> Thanks Tom,
>>>>>
>>>>> I only tried these in IE, but both request confirmation to close
>>>>> the window. Is there any way to put a close window button in that
>>>>> will not require confirmation and work in IE and other browsers?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Russell
>>>>>
>>>>>
>>>>> "Tom Pepper Willett" <tompepper@mvps.invalid> wrote in message
>>>>> news:%23ZFR$qJ2FHA.3892@TK2MSFTNGP12.phx.gbl...
>>>>>> Here are a couple you can try:
>>>>>>
>>>>>> <a href="javascript:window.close();">Close Window</a>
>>>>>>
>>>>>> --or--
>>>>>>
>>>>>> Form Button:
>>>>>>
>>>>>> <form>
>>>>>> <div align="center"><center><p><input TYPE="button"
>>>>>> NAME="close" VALUE="Close this Window"
>>>>>> onClick="self.close()"></p> </center></div>
>>>>>> </form>
>>>>>> --
>>>>>> ===
>>>>>> Tom "Pepper" Willett
>>>>>> Microsoft MVP - FrontPage
>>>>>> ---
>>>>>> FrontPage Support:
>>>>>>
http://www.frontpagemvps.com/
>>>>>> About FrontPage 2003:
>>>>>>
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
>>>>>> ===
>>>>>> "Russell" <xxxxrpp44@optonline.net> wrote in message
>>>>>> news:%23WPztSJ2FHA.2940@TK2MSFTNGP12.phx.gbl...
>>>>>>> Hello Trevor,
>>>>>>>
>>>>>>> This method for closing the window works great in IE but has no
>>>>>>> effect in Mozilla or Netscape. Any other ways that you know of?
>>>>>>>
>>>>>>> Thank you,
>>>>>>>
>>>>>>> Russell
>>>>>>>
>>>>>>>
>>>>>>> "Trevor L." <tandcl@homemail.com.au> wrote in message
>>>>>>> news:%23Z4zhKF2FHA.2880@TK2MSFTNGP12.phx.gbl...
>>>>>>>> Russell wrote:
>>>>>>>>> Thanks, I obviously meant add the close button to the window,
>>>>>>>>> not the image.
>>>>>>>>>
>>>>>>>>> Is there anyway to have a close button in that pop up that
>>>>>>>>> will just close the window and not have ask for confirmation
>>>>>>>>> first?
>>>>>>>>
>>>>>>>> Yes, the method I gave adds a close button to the pop-up
>>>>>>>> window. (I haven't actually tested this exact code, but I have
>>>>>>>> used similar.)
>>>>>>>>
>>>>>>>> Clicking on the close button will cause a prompt if the window
> is
>>> not
>>>>>>> opened
>>>>>>>> by yourself (not sure of the exact details).
>>>>>>>> To avoid this, give the window.opener property a dummy value -
>>>>>>>> can be anything. Then it is happy and doesn't prompt.
>>>>>>>>
>>>>>>>> Try this:
>>>>>>>> <input type="button" value="Close"
>>>>>>>> onClick="window.opener='fred';window.close()">
>>>>>>>>
>>>>>>>> --
>>>>>>>> Cheers,
>>>>>>>> Trevor L.
>>>>>>>> Website:
http://tandcl.homemail.com.au
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Russell
>>>>>>>>>
>>>>>>>>> "Trevor L." <tandcl@homemail.com.au> wrote in message
>>>>>>>>> news:O5jN%23yE2FHA.3204@TK2MSFTNGP14.phx.gbl...
>>>>>>>>>> Russell wrote:
>>>>>>>>>>> How would you add a "close window" button to this?
>>>>>>>>>>
>>>>>>>>>> You can't add a close button to a .jpg file.
>>>>>>>>>>
>>>>>>>>>> You need to call an .html file which displays the .jpg and
>>>>>>>>>> also has the close button in it
>>>>>>>>>>
>>>>>>>>>> Something like
>>>>>>>>>> <html><head></head>
>>>>>>>>>> <body>
>>>>>>>>>> <img src="pic1.jpg" alt="Picture 1"><br>
>>>>>>>>>> <input type="button" value="Close"
>>>>>>>>>> onClick="window.close()"> </body>
>>>>>>>>>> <html>
>>>>>>>>>>
>>>>>>>>>> If you name this pic1.html, then change
>>>>>>>>>> ONCLICK="fullScreen('pic1.jpg');"
>>>>>>>>>> to
>>>>>>>>>> ONCLICK="fullScreen('pic1.html');"
>>>>>>>>>> --
>>>>>>>>>> Cheers,
>>>>>>>>>> Trevor L.
>>>>>>>>>> Website:
http://tandcl.homemail.com.au