473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Close Window + Netscape7

<META HTTP-EQUIV="expires" content="0">
<META HTTP-EQUIV="pragma" content="no-cache">
<html>
<head>
<title>Fidelity NetBenefits</title>
</head>
<body BGCOLOR="#ffffff">

<script LANGUAGE="JavaScript">

function NoFramesAllowed() {
if (this.top != this) {
top.location.href=this.location.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="CloseWindow()" 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 1940


Asit wrote:
function CloseWindow()
{
if (window.name != "")
window.name = "";
window.close();
}
<input TYPE="BUTTON" onClick="CloseWindow()" 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_scripts_to_close_windows 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
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...
14
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...
9
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...
2
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...
2
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...
2
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....
2
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 ...
31
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...
14
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.