Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 11
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 18832 times and has 10 replies Next Thread
Male nasirzaman
Stranger



Pakistan
Joined: Jun 6, 2008
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
how to close a webpage using javascript in Mozilla firefox

Hi
I have facing a problem using Firefox browser. when close webpage using javascript code "self.close();"
it not work.

any help from your side

[Jun 6, 2008 1:08:58 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male falkencreative
Advanced Member
Member's Avatar

USA
Joined: Aug 14, 2007
Post Count: 1129
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

Just a couple general comments... If none of these work, a better description or a code snippet showing your problem would be helpful.

(all of the samples use "window.close()", but "self.close()" should work too.)

To close a window using a button in a form:
<form>
<input type=button value="Close Window" onClick="javascript:window.close();">
</form>


To close a window using a link:

<a href="javascript:window.close();">Close Window</a>


To close a window without getting a pop-up warning:
< a href="javascript:window.opener='x';window.close();">Close< /a>

----------------------------------------
Benjamin Falk | student : designer : developer
Twitter: falkencreative
----------------------------------------
[Edit 1 times, last edit by falkencreative at Jun 6, 2008 1:21:24 AM]
[Jun 6, 2008 1:20:58 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male nasirzaman
Stranger



Pakistan
Joined: Jun 6, 2008
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

I try all of these but in vain.


I clear to you that this problem only occur in Mozilla FireFox and work quite nicely with IE

Thanx
[Jun 6, 2008 1:35:02 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male falkencreative
Advanced Member
Member's Avatar

USA
Joined: Aug 14, 2007
Post Count: 1129
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

As I said above, a better description or a code snippet/URL showing your problem would be helpful.
----------------------------------------
Benjamin Falk | student : designer : developer
Twitter: falkencreative
[Jun 6, 2008 10:46:58 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

Why?

Anyone can close a window with the little button in the corner of every window. Why add another one?

Of course why are you opening a new window too? Let the user choose to open a new window or not.
[Jun 6, 2008 11:51:34 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Cuyahogen
Stranger



Scotland
Joined: Aug 4, 2008
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

Hi,

I'm having the same problem. Here's the code I'm using:

<html>
<head>
<script language="javascript">
function goNewWin() {
window.open("newpage.html",'TheNewpop','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');

self.close()

}

</script>
</head>

<body>
<a href="javascript:goNewWin()">Click to go to a new page</a>
</body>

I'm trying to link together a whole series of pages so that the link you click on will open a new page and also close the page you're looking at, so that you cannot use a back button to return to a previous page. I have my reasons.

I've had a look at some of the solutions posted here and they're not quite what I need. Any ideas?

Thanks in advance.
[Aug 4, 2008 4:41:06 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male ravikapa
Stranger




Joined: Aug 12, 2008
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
confused Re: how to close a webpage using javascript in Mozilla firefox

Hi,

I'm having the same problem. Here's the code I'm using:

<html>
<head>
<script language="javascript">
function goNewWin() {
window.open("newpage.html",'TheNewpop','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');

self.close()

}

</script>
</head>

<body>
<a href="javascript:goNewWin()">Click to go to a new page</a>
</body>

I'm trying to link together a whole series of pages so that the link you click on will open a new page and also close the page you're looking at, so that you cannot use a back button to return to a previous page. I have my reasons.

I've had a look at some of the solutions posted here and they're not quite what I need. Any ideas?

Thanks in advance.

[Aug 12, 2008 4:05:08 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male ravikapa
Stranger




Joined: Aug 12, 2008
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
confused Re: how to close a webpage using javascript in Mozilla firefox

hi this is the that will work fine for mozilla
if want this same function for IE
just Give Condition

useragent==IE then
skip this
bellow code

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");


------------------------------------Exapmle For Mozilla-----------
<head>

<script language="javascript" >


function ddd() {

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");

alert("This will close Current indow");
window.open('','_self');
window.close();
}
</script>
</head>
<body>

<input type= "button" name="CheckSpelling" value="ADD" onClick="ddd()" title="Spell

check">


</body>
[Aug 12, 2008 4:09:30 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

Why do you want to / need to?

Why add something to the site that every browser has in the corner or tab?
[Aug 12, 2008 10:52:45 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male lwsimon
Advanced Member



US
Joined: Sep 24, 2007
Post Count: 396
Status: Offline
Reply to this Post  Reply with Quote 
Re: how to close a webpage using javascript in Mozilla firefox

I'm trying to link together a whole series of pages so that the link you click on will open a new page and also close the page you're looking at, so that you cannot use a back button to return to a previous page. I have my reasons.


I hate to sound trite, but there is never an excuse for this. Yes, it can be done, and yes I know how to do it - but I won't support its use, so I won't teach it.

What is your reasoning for this? Perhaps we can help you solve your problem without resorting to hijacking the user's PC.
----------------------------------------
Simple is better.
[Aug 12, 2008 1:49:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread