473,738 Members | 8,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Close Window + Netscape7

<META HTTP-EQUIV="expires" content="0">
<META HTTP-EQUIV="pragma" content="no-cache">
<html>
<head>
<title>Fideli ty NetBenefits</title>
</head>
<body BGCOLOR="#fffff f">

<script LANGUAGE="JavaS cript">

function NoFramesAllowed () {
if (this.top != this) {
top.location.hr ef=this.locatio n.href;
return;
}
}

function CloseWindow()
{
if (window.name != "")
window.name = "";
window.close();
}
</script>

<center>
<table WIDTH="620" CELLPADDING="0" CELLSPACING="0" BORDER="0">

<tr><td></td><td COLSPAN="2"></td>
<td ALIGN="LEFT">
<form>
<input TYPE="BUTTON" onClick="CloseW indow()" VALUE="Click Here to
Close Your Browser">
</td>
</form>
</tr>
</table>

</center>
</body>
</html>

Save this as close.html

Open your Netscape 7 browser and then open this html file and click on
close button, it will not close the browser in Netscape but working
with Internet Explorer.

My Question is if the window is not being opened by the javascript,
then how to close the window by the Netscape ?

Is there any solution to this ?

Any help is appreciated.

Regards
Asit
Jul 23 '05 #1
3 1974


Asit wrote:
function CloseWindow()
{
if (window.name != "")
window.name = "";
window.close();
}
<input TYPE="BUTTON" onClick="CloseW indow()" VALUE="Click Here to
Close Your Browser"> Open your Netscape 7 browser and then open this html file and click on
close button, it will not close the browser in Netscape but working
with Internet Explorer.

My Question is if the window is not being opened by the javascript,
then how to close the window by the Netscape ?


Check your Netscape 7 JavaScript console, it will probably show you a
message that script tried to close a window that it is not allowed to close.
As far as I know there is nothing you can do about that, with Netscape 4
you could use signed script to request the privilege to close the window
but that doesn't seem to be supported by Netscape 7.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Lee
Asit said:
function CloseWindow()
{
if (window.name != "")
window.name = "";
window.close();
} Open your Netscape 7 browser and then open this html file and click on
close button, it will not close the browser in Netscape but working
with Internet Explorer.

My Question is if the window is not being opened by the javascript,
then how to close the window by the Netscape ?


This only works in Internet Explorer because of a bug.
You are not supposed to be able to close a window that
you didn't open with script.

The user certainly knows how to close his browser.

Jul 23 '05 #3
DU
Lee wrote:
Asit said:

function CloseWindow()
{
if (window.name != "")
window.name = "";
window.close();
}
Open your Netscape 7 browser and then open this html file and click on
close button, it will not close the browser in Netscape but working
with Internet Explorer.

My Question is if the window is not being opened by the javascript,
then how to close the window by the Netscape ?

This only works in Internet Explorer because of a bug.


Correct.
You are not supposed to be able to close a window that
you didn't open with script.

Correct. That's what MSDN says too. And even if a window was opened by
javascript, an user should be able to refuse that a script can close at
will the window (just as much as user setting, popup blocking software
can prevent scripts from opening new windows at will).

NS 7.2 and Mozilla-based browsers have
dom.allow_scrip ts_to_close_win dows user pref setting which is entirely
under the control of users.
The user certainly knows how to close his browser.


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Netscape 7.2 :)
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2192
by: Juan Garcia | last post by:
Subject says it all. Given: Window A with text field. Window B with a button (onClick opens Window C) Window C with a button (onClick I want it to modify text fields of Window A) I have tried storing the handle of Window A ( var winHandle = this; ) in a global variable/file ( globals.js ) and then accessing it from
14
7957
by: Nigel Mercier ® | last post by:
I'm just starting to learn JavaScript, so far I like it! I want to add some JS to my Ebay listings, to manually open a pop-up window. It works OK, but the JS gets rejected by Ebay. If I can't use JS in my listing, is there a way of using JS to resize a current window, and remove the toolbars etc, so it looks like a pop-up? --
9
8716
by: Guus Ellenkamp | last post by:
I want to use a second window to link to and put new content in it and pop up is some link is clicked. How to set the focus to the second window if it's already open. With what I do now, the window stays below my main window.
2
10413
by: Fleemo | last post by:
Is there any way to have a browser window resize itself when displaying a new HTML page? I'm using the javascript below to open a NEW window at a certain size, but I'd prefer the page to load in the same window, just sized differently. Here's the script I'm currently using: <a href="#"...
2
4963
by: Dom Nicholas | last post by:
Hi, My question is this : how do I detect from another window which didn't create a new window whether it exists ? For example, is there a window-id's container of some sort that hangs around that I can interrogate ? I would like to find a better way of doing the following. I have a window (call it Win) that creates a new window (call it Win2) using window.open().
2
4137
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size. However, this is not happening in IE 5. Can anyone help me solve this problem? Code: Script:
2
12286
by: Geoff Wilkins | last post by:
I fear this may be a FAQ - in which case my apologies - but I've failed to track the answer down. I want to close a window from another window it opened. I assumed that this.window.opener.close(); would work, and it does work with my Netscape 6; but my IE 6 gives me an error-message, "this.window.opener is null or not an object".
31
2845
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy) on "main" does not setting the focus to "extern".
14
11094
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.