473,386 Members | 1,846 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,386 software developers and data experts.

Closing Parent window without prompt for Firefox 2 and IE 7

I need to know how to open a pop up and close the main window without
a prompt in Firefox 2 and IE 7. Anybody have any ideas on how to do
that.

I currently have this and it works in IE 6 and Firefox 1.5:

function windowClose()
{
if(navigator.appName=="Microsoft Internet Explorer")
{
this.focus();self.opener = this;self.close();
}
else
{
window.open('','_parent',''); window.close();
}
}

Thanks,
Tony

Feb 21 '07 #1
10 11414
Tony said the following on 2/21/2007 3:11 PM:
I need to know how to open a pop up and close the main window without
a prompt in Firefox 2 and IE 7.
You can't. The developers, thankfully, listened to the wish of users not
to have people closing windows they didn't open so now you can't.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 21 '07 #2
dang. Well we got it to work in IE 6 and Firefox 1.5

Feb 22 '07 #3
Tony

<missing quote>
Closing parent window
</missing quote>
dang. Well we got it to work in IE 6 and Firefox 1.5
Well, you have just managed to loose my probably not inconsiderable browser
history, particularly the google page I had used to find your site. You
know, history, the stuff behind the back button.

Now I have to close your new window, open another window, tell google what I
was searching for and try to navigate back to where I was. And I have now
forgotton the various google searches I used to get to this point. They are
in the history you so conveniently trashed.

Please give me the URL of your site so I can add it to my list of sites
never to visit.
Feb 22 '07 #4
It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.

Feb 22 '07 #5
Tony wrote:
It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.
You didn't say that. Puts a whole different slant on the matter.
Feb 22 '07 #6
dd
On Feb 22, 1:32 am, "Richard Formby" <newsgro...@barefile.com.au>
wrote:
Well, you have just managed to loose my probably not inconsiderable browser
history, particularly the google page I had used to find your site. You
know, history, the stuff behind the back button.

Now I have to close your new window, open another window, tell google what I
was searching for and try to navigate back to where I was. And I have now
forgotton the various google searches I used to get to this point. They are
in the history you so conveniently trashed.

Please give me the URL of your site so I can add it to my list of sites
never to visit.
Richard, how did you manage to destroy your
history visiting his site when he didn't
post the URL to his site? I can't quite get
my head around this one. You even ask him
for the URL of his site at the end of your
post.

Feb 22 '07 #7
dd
On Feb 22, 5:23 am, "Tony" <t3proje...@gmail.comwrote:
It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.
I had to view your profile to see if the link to
your site (that Richard complained destroyed his
history). Do you always refer to yourself in the
third person? You know that's the first sign of
madness don't you ;-)

Feb 22 '07 #8
dd wrote

[a site that opens a new window and then closes the parent]
Richard, how did you manage to destroy your
history visiting his site when he didn't
post the URL to his site? I can't quite get
my head around this one. You even ask him
for the URL of his site at the end of your
post.
I didn't need to visit the site. It was merely a thought exercise. Try it
for your self, manually:

Google, change the search argument, google, change, google..., visit a site,
follow a few links. Then a few more. You know how hperlinks work, you can
spend all night following them.

Then (as per the exercise) choose to open a link in a new window by leaning
on your Ctrl key or whatever.

Fine, you have your original window with all the history. All the hyperlinks
you used to get to here.

You also have a new window with a blank back button.

Now *you* close your original window. *You* have just thrown away all of
your history. All you have left is the newly opened window with no history
and a blank back button.

What about that other intersting link you saw a few sites ago (in your
original window), next to the one you clicked way back then, back in your
history. It's gone. Damn. You shouldn't have closed that first window[1].

Now, imagine a real live web site *doing this automatically for you* :-(

Some things that are possible simply should not be done in the WWW context.
Intranet is, of course, a possible exeption.

[1] I regularly have half a dozen or more browser windows open, some of them
displaying multiple tabs. When I close the wrong one accidently I get really
annoyed at myself. The cat abruptly flees the room.

Feb 22 '07 #9
On Feb 22, 10:40 am, Richard Formby wrote:
<snip>
Some things that are possible simply should not be done in the
WWW context. Intranet is, of course, a possible exeption.
<snip>

In many cases it is the fact that things have been done in the WWW
context that should not have been done that has resulted in those
facilities being removed or restricted in web browsers. And once
removed the possibility also disappears in the Intranet context, where
it may have been better justified.

This is the OP's problem. It used to be possible to close windows not
opened by scripts in some browsers. If nobody had ever done that on
the Internet there would have been no reason to close the loophole
that allowed it. That did not happen, the loophole was closed, and now
the possibility is denied to those writing for Internets, were the
consequences of the closing of a first window would be the
responsibility of an employer.

Richard.

Feb 22 '07 #10
Richard Formby said the following on 2/22/2007 1:30 AM:
Tony wrote:
>It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.

You didn't say that. Puts a whole different slant on the matter.
That is what is always said after you tell them how dumb an idea it is.
Want a little proof? If it is an internal website then you control all
the browsers. Force them to use IE6 or FF1.5 and you have no issue.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 22 '07 #11

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

Similar topics

1
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
3
by: =?Utf-8?B?Vk1J?= | last post by:
How can I close popup window automatically when I close the parent window (the application itself)? Thanks.
0
by: meenu_susi | last post by:
hi.. i am having a default html page... and i want that page to get open without toolbar,addressbar..... i have written a javascript funtion for that.. in that i have used self.close(); but it...
2
by: javanet | last post by:
Hi all, 1) i opened a parent window. 2) then i opend a child window thruogh this parent window. Now i want to close child window before closing the parend window means my clients can not be...
3
by: guest | last post by:
I have a problem, I have Javascript that opens a popup. I want to avoide the user from closing the parent window first. I dont want to use showDialog, I want to use window.open() only.. Is there any...
1
by: honey99 | last post by:
Hi! i have a same combobox in parent window and child window.If i enter a value in combobox in child window it should automaticall update in parent window without refreshing the parent window page.I...
12
by: Lahiru778 | last post by:
I require to appear the Name which i click on the "new.php" page in the "Window_open.php" page..I use some Java Script also to accomplish this but I couldn't.. Could you pleas Help ...!!! ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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,...

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.