Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the X box

Status
Not open for further replies.

MD

Programmer
Oct 19, 1999
4
IN
Hi,<br>
<br>
I'm not really sure what the name of the box in the top right hand corner of a windows frame with a X in it to close a window is, but does anyone know how to disable it within a frame?<br>
<br>
Alternatively is there a way of calling a Javascript function when it is pressed?<br>
<br>
Thanks,<br>
Mike
 
Well, the way I see it, you have two options:<br>
<br>
1) you can put up a modal window (i'm not sure if my coding is correct, but there was a post prevously on the subject)<br>
<br>
-or-<br>
<br>
2) you can put up a normal window with an onUnLoad tag in the head, calling a function in the parent window<br>
<br>
soloutions:<br>
<br>
1)document.newModalWindow (again, really not sure)<br>
<br>
2)in the windows .html file, in the body tag, put onUnLoad=&quot;_the_function_name_&quot;<br>
<br>
not sure how helpfull this was, but maybee it'll get you started, <p>theEclipse<br><a href=mailto: > </a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>
 
Thanks for the suggestions.<br>
<br>
onUnload seems to be called everytime the page gets refreshed not just on exit, so I'm not sure that will do it.<br>
<br>
Will have a look around for info on newModalWindow<br>
<br>
Cheers,<br>
Mike
 
You are correct that onUnLoad triggers when the page is refreshed, but it also triggers whenever the page is unloaded ex. when a new page is loaded into the browser.<br>
<br>
I later thought of another option, but I dont know if it exists.<br>
<br>
window.onClose()<br>
<br>
dont think it exists, but if it does, that would do the trick.<br>
<br>
and about the newModalWindow, <br>
try posting a thread and see what you get,<br>
and also look around in the prevous threads for something refrencing to one.<br>
<br>
<p>theEclipse<br><a href=mailto: > </a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>
 
If you use an onUnload= function that simply re-opens the window <i>window.parent.open(windowname,windowssource,sindowattributes0</i> it shouldn't cause any problem when clicking the Refresh button. Also; if you add a <i>; document.refresh();</i> to the end of the previous code; that would ensure that it actually does get refreshed in the case that they try hitting the REfresh button :) <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top