Paul in South Africa

msg:1487741 | 12:02 pm on Nov 16, 2004 (gmt 0) |
Not tested but should get you started Somewhere where you have your Javascript insert function clswin() { close();} Then you can call the clswin function using something like <a onclick="clswin();" href="#"><IMG border="0" src="images/close_1.jpg"></a> making sure that your image is referenced correctly or using appropriate text.
|
Lance

msg:1487742 | 12:32 pm on Nov 16, 2004 (gmt 0) |
Or: (Looks like a button) <button onclick="self.close();">Close Me</button> Or: (Looks like a link) <a href="#" onclick="self.close();">Close Me</a> Or: (Looks like plain text) <a onclick="self.close();">Close Me</a> Or for that matter, if you put the "onclick=" in your <body> tag, clicking anywhere in the small window will close it. <body onclick="self.close();">
|
adni18

msg:1487743 | 12:57 pm on Nov 16, 2004 (gmt 0) |
The <button> tag is not completely compatible with all browsers. try this: <input type=button onClick="if(window.opener){window.close()}else{alert('This page is not being displayed as a popup.')}">
|
contentmaster

msg:1487744 | 7:32 am on Nov 18, 2004 (gmt 0) |
| Or: (Looks like a link) <a href="#" onclick="self.close();">Close Me</a> |
| I tried to insert this link on the small window (this is a script that i am using - which shows a small pop up type of page over my original page which closes automatically in 10 secs) and on clicking this link a window appears asking if i want to close the window...on pressing yes the entire page closes...even my home page!:(( What should be done so that only the small window closes and not my home page?
|
dreamcatcher

msg:1487745 | 9:36 am on Nov 18, 2004 (gmt 0) |
Try the following: <a href="javascript:self.close()">Close Me</a> :)
|
Lance

msg:1487746 | 2:31 pm on Nov 18, 2004 (gmt 0) |
| What should be done so that only the small window closes and not my home page? |
| Did you put the link in the small window, or in the home page itself? It needs to be in the small window.
|
Bernard Marx

msg:1487747 | 2:40 pm on Nov 18, 2004 (gmt 0) |
[pre] <input type="button" value="Click Here for instructions in closing this window" onclick="alert('Closing this window:\nClick the small black X at the top corner of the window')" /> [/pre]
|
adni18

msg:1487748 | 2:46 pm on Nov 18, 2004 (gmt 0) |
Or: <a href="#" onClick="window.close()">close</a>
|
contentmaster

msg:1487749 | 9:26 am on Nov 21, 2004 (gmt 0) |
I am putting the codes in the small window.but the main web page is closing ...what is happening!
|
adni18

msg:1487750 | 6:08 pm on Nov 21, 2004 (gmt 0) |
have you tried these codes in other browsers? maybe the problem lies there.
|
|