close window (for firefox)

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 13134 Views - Last Post: 30 January 2010 - 07:16 PM

#1 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

close window (for firefox)

Post icon  Posted 16 January 2010 - 06:56 AM

Hello people!! I need some help in something...
I am implementing a web page to be used as a tutorial to a program. All I need help in is that I use Hyperlinks to other pages and work just fine but this doesn't happen to my EXIT hyper-link...

		<li><a href="cancellation.html"><font size="3">CANCELLATION</font></a></li>
		<li><a href="incrementdate.html"><font size="3">INCREMENT</font><font size="3"> DATE</font></a></li>
		<li><a href="setdate.html"><font size="3">SET</font><font size="3"> DATE</font></a></li>
		<li><a onclick="self.close();"><font size="3">EXIT</font></li> 
The last line is an EXIT message and I want it to close the tab or the window opened from user when requested help.

The last line is "EXIT" onclick="self.close()" but it does something strange....
It closes the window if opened in Microsoft Internet Explorer but not in Mozilla Firefox!!! It closes the tab in firefox if opend as an IE-Tab (plug-in)

For the record I am using Frontpage 2003 and the webpage is going to be viewed in CentOS linux using mozilla firefox as I have been told...

Any ideas???? many thanks in advance!!!

Is This A Good Question/Topic? 0
  • +

Replies To: close window (for firefox)

#2 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 16 January 2010 - 12:09 PM

it also closes
Google Chrome
Opera 10.10
and again Internet Explorer 8...

Mozilla firefox and Firefox portable edition :crazy: just make my life miserable!!!!
Was This Post Helpful? 0
  • +
  • -

#3 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 16 January 2010 - 12:52 PM

Tried searching the forum but nothing similar!! Anyone that can help???

This post has been edited by Miklo: 16 January 2010 - 12:55 PM

Was This Post Helpful? 0
  • +
  • -

#4 zombie_chan51   User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 327
  • Joined: 16-March 08

Re: close window (for firefox)

Posted 16 January 2010 - 02:36 PM

on firefox
go to about:config

and change dom.allow_script_to_close_windows and set it to true

if this help you, please hit This Post was Helpful. It makes me feel good about myself.

This post has been edited by drjoe51: 16 January 2010 - 03:19 PM

Was This Post Helpful? 0
  • +
  • -

#5 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 16 January 2010 - 06:40 PM

View Postdrjoe51, on 16 Jan, 2010 - 01:36 PM, said:

on firefox
go to about:config

and change dom.allow_script_to_close_windows and set it to true

if this help you, please hit This Post was Helpful. It makes me feel good about myself.


I would really love to click that help you button but here is the thing:

1.where do i find the about:config
2.if this is going to be tested on a machine that I can not access to change it how is this supposed to work??

isn't there another way of doing it???
Was This Post Helpful? 0
  • +
  • -

#6 zombie_chan51   User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 327
  • Joined: 16-March 08

Re: close window (for firefox)

Posted 16 January 2010 - 06:59 PM

to get to the config
you just type about:config in the address bar

i don't think there is any other way of doing it by script.
Was This Post Helpful? 1
  • +
  • -

#7 psyking   User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 173
  • Joined: 17-January 10

Re: close window (for firefox)

Posted 17 January 2010 - 01:10 AM

What you could try is using instead of
<a onclick="self.close();">
you could use instead:
<a href="java script:window.close()">
(Just get rid of the space between java and script.)

This post has been edited by psyking: 17 January 2010 - 01:12 AM

Was This Post Helpful? 0
  • +
  • -

#8 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 17 January 2010 - 04:33 AM

View Postpsyking, on 17 Jan, 2010 - 12:10 AM, said:

What you could try is using instead of
<a onclick="self.close();">
you could use instead:
<a href="java script:window.close()">
(Just get rid of the space between java and script.)




psyking,
can you please check this setting in your browser as zombie_chan51 said????
because even with the javascript you sent me it doesn't work in firefox as everything else I tried before....



zombie_chan51,
I changed it in my browser and it really worked. this means that if i don't change this there is no other way of using this self.close() ?? In the labs are more than 50 computers... i won't be able to change it in all!!! thus i am not sure the marking panel will do the testing in the labs.... :(
Was This Post Helpful? 0
  • +
  • -

#9 zombie_chan51   User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 327
  • Joined: 16-March 08

Re: close window (for firefox)

Posted 17 January 2010 - 08:12 AM

Yeah, I wish I knew another way. Maybe some else knows on this forum, but I can't think of anything else.
Was This Post Helpful? 0
  • +
  • -

#10 rikkit   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 09

Re: close window (for firefox)

Posted 17 January 2010 - 09:03 AM

I think Firefox asks the user (the site you are viewing is trying to close the window..) if the script is activated but the about:config setting is default.
Was This Post Helpful? 0
  • +
  • -

#11 psyking   User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 173
  • Joined: 17-January 10

Re: close window (for firefox)

Posted 17 January 2010 - 12:19 PM

Firefox does not allow a website to close a tab that was not opened using the window.open() command first. I found this at the Mozilla Website.

If you want to close a window using either the command I gave you or the one you were originally using, you would have to do something like this (from the Mozilla website):
<script type="text/javascript">
//Global var to store a reference to the opened window
var openedWindow;

function openWindow(){ openedWindow = window.open('open a window'); }
function closeOpenedWindow(){ openedwindow.close(); }
</script>
<a href="java script:openWindow;">Open a window</a>
<a href="java script:closeOpenedWindow();">Close the opened window</a>
So if you wanted to, you could probably just make a page that automatically pops up your site and then window.close() and self.close() would both work for closing your page.
Was This Post Helpful? 0
  • +
  • -

#12 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 18 January 2010 - 07:02 PM

View Postpsyking, on 17 Jan, 2010 - 11:19 AM, said:

Firefox does not allow a website to close a tab that was not opened using the window.open() command first. I found this at the Mozilla Website.

If you want to close a window using either the command I gave you or the one you were originally using, you would have to do something like this (from the Mozilla website):
<script type="text/javascript">
//Global var to store a reference to the opened window
var openedWindow;

function openWindow(){ openedWindow = window.open('open a window'); }
function closeOpenedWindow(){ openedwindow.close(); }
</script>
<a href="java script:openWindow;">Open a window</a>
<a href="java script:closeOpenedWindow();">Close the opened window</a>
So if you wanted to, you could probably just make a page that automatically pops up your site and then window.close() and self.close() would both work for closing your page.



Unless i've done something really horrible i get this...
Firefox can't find the file at /C:/Users/Michael/Desktop/help/java script:openWindow;.
Any ideas???

Am i supposed to have as ref or hyperlink?? and the script should be at the top of the coding page or just above the use of the open window / close window is just fine??
Was This Post Helpful? 0
  • +
  • -

#13 psyking   User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 173
  • Joined: 17-January 10

Re: close window (for firefox)

Posted 18 January 2010 - 08:24 PM

Try doing it like this:
<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>
	<head>
		<title></title>
		<script type="text/javascript">

			var openedWindow;

			function openWindow() {
				openedWindow = window.open('Open the page');
			}

			function closeWindow() {
								//Close the page
				openedwindow.close();
			}

		</script>
	</head>
	<body>
		<a href="java script:openWindow();">Open the window</a>
		<a href="java script:closeWindow();">Close the window</a>
	</body>
</html>

Was This Post Helpful? 0
  • +
  • -

#14 Miklo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 24-December 09

Re: close window (for firefox)

Posted 19 January 2010 - 04:16 AM

i suupose there is something missing from my computer....

because even now i get the same message....

Quote

File not found

Firefox can't find the file at /C:/Users/Michael/Desktop/java script:openWindow();.




* Check the file name for capitalization or other typing errors.

* Check to see if the file was moved, renamed or deleted.

Was This Post Helpful? 0
  • +
  • -

#15 psyking   User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 173
  • Joined: 17-January 10

Re: close window (for firefox)

Posted 20 January 2010 - 08:13 PM

Are you removing the space between java and script?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2