how can I close my browser from with in my home page
I wish to close my browser from my home page , i am using html and writing it with 'dreamweaver 8
All Replies (6)
Hi Steve, do you mean you want to be able to use a script in the page itself to close the tab containing that page?
Most likely you can't do it that way. Firefox ignores attempts by web page scripts to close the current tab unless a script also was used to open the current tab. Usually that would not apply to your home page, since that opens automatically with Firefox.
For more information: https://developer.mozilla.org/docs/Web/API/Window/close
sorry no not quite i am trying to close the browser from a web page not the home page,
here is what i have done so far
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-image: url(papyrus7.jpg);
}
.style1 {font-size: 36px}
-->
</style>
untill we meet again
the <script> at the bottom and the <a href > only give me a blank page i want to cloes the browser completly
steve61 said
<script type="text/javascript"> function closeme() { window.open('', '_blank', ''); window.close(); } </script>
It's not surprising that you are launching a new tab/window, since you are using window.open() with a target of _blank. And it's not surprising that window.close() fails for the reason I explained before.
You may want to explore other sites for additional information: Where to go for developer support.
yes i realize after the fact thats all it did i can't find any thing that will alouw me to close the browser, they all give 'close window' scripts, one i found was reported to work in 'IE' but i could not findsomething for 'ff'
the page sent you starts from a link in my home page here is that page again
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-image: url(papyrus7.jpg);
}
.style1 {font-size: 36px}
-->
</style>
untill we meet again
**********
where the stars are i am wanting to close the browser maybe with the word s 'browser now colsing' coming up on the screen
your help is much apreshiated (evin if i can't spell)
What I am saying is, being unable to close that tab is on purpose: window.close() is intentionally blocked on windows that were not opened by scripts. If there is a workaround, it is a security flaw that should be closed.
ok thanks for your help any way
steve