21 answers
- 1
- 2
Next
Hi everyone,
Personally, I would put:
<input type='button' value='Close' onClick='self.close()' name="button">
It's JavaScript. In fact, it's a button, not very aesthetic, I agree because it's gray, but somewhere in CCM, there's a post that talks about the possible modifications to the color and plenty of fully customizable options for buttons in JavaScript.
In any case, give it a try and let us know what you think...
Important: this code should be inserted exactly where you want your page to close.
http://abarka.free.fr
When the syntax is right, EVERYTHING is right; -))
Personally, I would put:
<input type='button' value='Close' onClick='self.close()' name="button">
It's JavaScript. In fact, it's a button, not very aesthetic, I agree because it's gray, but somewhere in CCM, there's a post that talks about the possible modifications to the color and plenty of fully customizable options for buttons in JavaScript.
In any case, give it a try and let us know what you think...
Important: this code should be inserted exactly where you want your page to close.
http://abarka.free.fr
When the syntax is right, EVERYTHING is right; -))
Hello everyone.
If you find the Close button ugly (and I agree).
Well, as ipl said, you can put an image or you can modify the style of the button:
In head:
In body:
For jp.bond,
In Firefox, in order to close a window via JavaScript, it must have been opened by JavaScript.
See Firefox JavaScript Console: "Scripts cannot close a window that was not opened by a script."
To open a window, it's:
window.open('mypage.htm','mypagename','options');
Here are the options if you're interested:
option description
directory = yes/no Displays navigation buttons or not
location = yes/no Displays the address bar or not
menubar = yes/no Displays the menu bar (file, edit, ...) or not
resizable = yes/no Defines whether the window size is adjustable or not
scrollbars = yes/no Displays scrollbars or not
status = yes/no Displays the status bar or not
toolbar = yes/no Displays the toolbar or not
width = width (in pixels) Defines the width
height = height (in pixels) Defines the height
The options must be entered one after the other, separated by commas, without spaces.
There you go :)
If you find the Close button ugly (and I agree).
Well, as ipl said, you can put an image or you can modify the style of the button:
In head:
<style> .button { BORDER: #1473c0 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 10px; COLOR: #1473c0; FONT-FAMILY: verdana; BACKGROUND-COLOR: #FFFFFF; } </style> In body:
<input class="button" type="button" value="Close" />
For jp.bond,
In Firefox, in order to close a window via JavaScript, it must have been opened by JavaScript.
See Firefox JavaScript Console: "Scripts cannot close a window that was not opened by a script."
To open a window, it's:
window.open('mypage.htm','mypagename','options');
Here are the options if you're interested:
option description
directory = yes/no Displays navigation buttons or not
location = yes/no Displays the address bar or not
menubar = yes/no Displays the menu bar (file, edit, ...) or not
resizable = yes/no Defines whether the window size is adjustable or not
scrollbars = yes/no Displays scrollbars or not
status = yes/no Displays the status bar or not
toolbar = yes/no Displays the toolbar or not
width = width (in pixels) Defines the width
height = height (in pixels) Defines the height
The options must be entered one after the other, separated by commas, without spaces.
There you go :)
Good evening ElZorro, good evening everyone,
It depends if it's the main page or an additional window:
try window.close()
(adapt this to what you are doing: a button, a link-href, a link-onClick, etc.)
@12C4 ... In medio stat virtus ...
Ipl
It depends if it's the main page or an additional window:
try window.close()
(adapt this to what you are doing: a button, a link-href, a link-onClick, etc.)
@12C4 ... In medio stat virtus ...
Ipl
Hello ElZorro (the fox in Spanish)
Here's what I use on my pages: this system has the main advantage of returning to the previously opened page by the user (it's the equivalent of the back arrow in Internet Explorer) but also a drawback: if the user has disabled JavaScript in Internet Explorer, I believe it won't work.
<strong><a href="Javascript:history.go(-1)">myLink</a>
http://abarka.free.fr
When the syntax works, EVERYTHING works ;-))
Here's what I use on my pages: this system has the main advantage of returning to the previously opened page by the user (it's the equivalent of the back arrow in Internet Explorer) but also a drawback: if the user has disabled JavaScript in Internet Explorer, I believe it won't work.
<strong><a href="Javascript:history.go(-1)">myLink</a>
http://abarka.free.fr
When the syntax works, EVERYTHING works ;-))
For your information, this code:
<input type='button' value='Close' onClick='self.close()' name="button">
or
<input type='button' value='Close' onClick='window.close();' name="button">
does not work in Firefox... oops!
any idea?
thank you...
<input type='button' value='Close' onClick='self.close()' name="button">
or
<input type='button' value='Close' onClick='window.close();' name="button">
does not work in Firefox... oops!
any idea?
thank you...
But where do we need to put windows.close()??? If I put it in the html link it doesn't work (which is kind of normal).
Good evening ElZorro, good evening everyone,
In my post, I said to you:
>adapt this to what you do: a button, a link-href, a link-
>onClick, etc.)
- What txiki indicates (Input method and button) works very well!
- If you prefer a text-link-href, you will code: <a href="javascript:window.close();">Close</a>
- If you prefer an image-link-href, you will code: <a href="javascript:window.close();"><img src=image.gif border=0 width=20, height=15></a>
- If you prefer a text-link-onClick, you will code: <a href="#" onClick="window.close();">Close</a>
- etc.
Also, to complement txiki's writings, know that you can replace the gray button from the INPUT method with an image of your choice.
@12C4 ... In medio stat virtus ...
Ipl
In my post, I said to you:
>adapt this to what you do: a button, a link-href, a link-
>onClick, etc.)
- What txiki indicates (Input method and button) works very well!
- If you prefer a text-link-href, you will code: <a href="javascript:window.close();">Close</a>
- If you prefer an image-link-href, you will code: <a href="javascript:window.close();"><img src=image.gif border=0 width=20, height=15></a>
- If you prefer a text-link-onClick, you will code: <a href="#" onClick="window.close();">Close</a>
- etc.
Also, to complement txiki's writings, know that you can replace the gray button from the INPUT method with an image of your choice.
@12C4 ... In medio stat virtus ...
Ipl
Hi everyone,
I didn't mention the text link because he wanted a button and besides, I wasn't very sure about the exact syntax.
If you prefer a text-link-onClick, you would code: <a href="#" onClick="window.close();">Close</a>
Thanks ipl for your additional comments (if I may say so) ;-)) Talk to you later
http://abarka.free.fr
When the syntax goes well, EVERYTHING goes well ;-))
I didn't mention the text link because he wanted a button and besides, I wasn't very sure about the exact syntax.
If you prefer a text-link-onClick, you would code: <a href="#" onClick="window.close();">Close</a>
Thanks ipl for your additional comments (if I may say so) ;-)) Talk to you later
http://abarka.free.fr
When the syntax goes well, EVERYTHING goes well ;-))
Thank you all, I managed to create an onclick button, but I need to find a way to make it look a bit nicer because right now, it's really ugly (lol).
Hello elzorro and the others,
If you use Dreamweaver, you can insert a Flash element and in the window that opens, you can choose a button style. There are some really good ones in the basic installation, at least in mine.
See you later
http://abarka.free.fr
When the syntax is good, EVERYTHING is good ;-))
If you use Dreamweaver, you can insert a Flash element and in the window that opens, you can choose a button style. There are some really good ones in the basic installation, at least in mine.
See you later
http://abarka.free.fr
When the syntax is good, EVERYTHING is good ;-))
Good evening ElZorro, Txiki, good evening everyone,
You can put the image of your choice to replace the ugly button!
<input type="image" src="CCM.gif" onMouseOver="..." onMouseOut="...'" onClick="..." width=w height=h>
@12C4 ... In medio stat virtus ...
Ipl
You can put the image of your choice to replace the ugly button!
<input type="image" src="CCM.gif" onMouseOver="..." onMouseOut="...'" onClick="..." width=w height=h>
@12C4 ... In medio stat virtus ...
Ipl
All simple:
<a href="#" onClick="window.close();"> <input type="submit" name="Submit" value="Close this window"> </a>
Button that can also accept effects with CSS...
<a href="#" onClick="window.close();"> <input type="submit" name="Submit" value="Close this window"> </a>
Button that can also accept effects with CSS...
Hello,
I have the same problem and I don't quite understand you. I must say that I am not an expert.
I work with Dreamweaver and I just want a link on the text "Close" that, when clicked, closes the page. Is there a code that works in all browsers (IE6, IE7, Firefox, Opera...)?
A big thank you!
Joanie
P.S. Please be clear, as I'm not good at coding.
I have the same problem and I don't quite understand you. I must say that I am not an expert.
I work with Dreamweaver and I just want a link on the text "Close" that, when clicked, closes the page. Is there a code that works in all browsers (IE6, IE7, Firefox, Opera...)?
A big thank you!
Joanie
P.S. Please be clear, as I'm not good at coding.
Hi joanie22,
You put the example below.
<a href="javascript:window.close();"> close the page </a>
NOTE: you can replace the word "javascript" with # which has the same effect.
--
Happiness is the only thing that one can give without having it.
You put the example below.
<a href="javascript:window.close();"> close the page </a>
NOTE: you can replace the word "javascript" with # which has the same effect.
--
Happiness is the only thing that one can give without having it.
I MADE A WEBSITE THAT I PUBLISHED BY MISTAKE WHILE IT IS NOT FINISHED I WANT TO CLOSE IT HOW DO I DO TO CLOSE IT?
ESPECIALLY SINCE IT IS MADE WITH ".FR.GD" PLEASE ANSWER ME BY EMAIL THANK YOU IN ADVANCE SEE YOU +
ESPECIALLY SINCE IT IS MADE WITH ".FR.GD" PLEASE ANSWER ME BY EMAIL THANK YOU IN ADVANCE SEE YOU +
- 1
- 2
Next