|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 11
|
|
| Author |
|
|
Stranger Pakistan Joined: Jun 6, 2008 Post Count: 2 Status: Offline |
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 |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
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>To close a window using a link: 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] |
||
|
|
Stranger Pakistan Joined: Jun 6, 2008 Post Count: 2 Status: Offline |
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 |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
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 |
||
|
|
Advanced Member USA Joined: Nov 27, 2003 Post Count: 6285 Status: Offline |
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. |
||
|
|
Stranger Scotland Joined: Aug 4, 2008 Post Count: 2 Status: Offline |
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. |
||
|
|
Stranger Joined: Aug 12, 2008 Post Count: 2 Status: Offline |
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. |
||
|
|
Stranger Joined: Aug 12, 2008 Post Count: 2 Status: Offline |
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> |
||
|
|
Advanced Member USA Joined: Nov 27, 2003 Post Count: 6285 Status: Offline |
Why do you want to / need to? Why add something to the site that every browser has in the corner or tab? |
||
|
|
Advanced Member US Joined: Sep 24, 2007 Post Count: 396 Status: Offline |
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. |
||
|
|
|
|
|
Current timezone is GMT Jun 20, 2013 3:56:04 AM |