473,659 Members | 3,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't open a window after closing one, why?

In my jsp I have:

<Script langauge="Javas cript">
window.location .replace("first url");
window.close();
window.open("se cond url");
</Script>

The child window opens from the parent window just fine and then it
closes, but I cannot reopen a new child window; I am working with IE 6
under XP.

I would have thought a simple example like this would have given me the
result I was looking for. But apparently, its not so simple since
nothing happens after the child window closes. Why won't my second
child window open?

Anything wrong with my syntax? Thanks for any and all help.

Nelson

Feb 9 '06 #1
6 1979
Here is an explanation on why it is not working.

If you open the file on your location machine, initially you will get a
activex error, but once you enable it, everything will work as desired.

But, if that file is on a webserver, like
(http://www.cnn.com/test.html), XP will block it as it considers the
window.open call as NOT user initiated. There is NO workaround for that
as you can not open automatic pop up windows under IE 6 XP. There are
however some wierd workarounds for opening pop up windows, but those do
not look professional.

- shiva vannavada

Feb 9 '06 #2
slacker said the following on 2/9/2006 4:52 PM:
In my jsp I have:

<Script langauge="Javas cript">
window.location .replace("first url");
window.close();
window.open("se cond url");
</Script>

The child window opens from the parent window just fine and then it
closes, but I cannot reopen a new child window; I am working with IE 6
under XP.
With that code, it is a wonder that you even closed the window.
I would have thought a simple example like this would have given me the
result I was looking for. But apparently, its not so simple since
nothing happens after the child window closes. Why won't my second
child window open?


Because the code to open the window is now gone.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 10 '06 #3
sh************* @gmail.com said the following on 2/9/2006 5:17 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
Here is an explanation on why it is not working.
No, that is not an explanation of why it is not working.
If you open the file on your location machine, initially you will get a
activex error, but once you enable it, everything will work as desired.
I get no activeX error when opening that file on my local machine.
But, if that file is on a webserver, like
(http://www.cnn.com/test.html), XP will block it as it considers the
window.open call as NOT user initiated.
No, XP does not block popups. IE6 does though.

There is NO workaround for that as you can not open automatic pop up
windows under IE 6 XP.
Irrelevant but finally some truth in your post.

There are however some wierd workarounds for opening pop up windows,
but those do not look professional.


"weird workarounds"?

Examples?
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Feb 10 '06 #4

Randy Webb wrote:
sh************* @gmail.com said the following on 2/9/2006 5:17 PM:

Please quote what you are replying to.


Shiva did, at least I can see all of my post to which the user was
responding too.

Shiva, thank you for responding to a question that an individual posted
on the internet, namely and specifically me.

Randy, based on some of your responses, you seem to be somebody who is
intentionally looking to fight and argue. Good luck in your quest.

Nelson
Here is an explanation on why it is not working.

No, that is not an explanation of why it is not working.

There is NO workaround for that as you can not open automatic pop up
windows under IE 6 XP.


Irrelevant but finally some truth in your post.


Feb 10 '06 #5
slacker wrote:
In my jsp I have:
JSP are _JavaServer_ Pages. Java != JavaScript. That this code is
maybe part of JSP code has exactly no meaning regarding the execution
of the client-side script code generated by it. When it is about
client-side scripting, always post generated code, not generating one.
<Script langauge="Javas cript">
window.location .replace("first url");
window.close();
window.open("se cond url");
</Script>
This cannot work.

1. The `script' element requires the `type' attribute:

<script type="text/javascript">

2. The `script' element does not have a `langauge' attribute.
It has a `language' attribute which is deprecated since HTML 4.0
and can be safely omitted.

<URL:http://validator.w3.or g/>

3. You replace the location of the current window, with all the code in it
gone.

Then you /think/ you close the current window, but there is no close()
call left because of the former. Even if it were executed, the close()
call would then definitely remove all the currently executing code from
the memory.

Then you /think/ you call window.open(), but there is no open() call
left because of the former.

4. You do not feature-test any of these host object's methods, which is
error-prone: <URL:http://pointedears.de/scripts/test/whatami#inferen ce>

Bottom line: You should drink much more tea[tm] when coding.
Anything wrong with my syntax?


Ask if anything is right, that answer would have been shorter: no.
PointedEars
Feb 10 '06 #6
slacker said the following on 2/10/2006 7:47 AM:
Randy Webb wrote:
sh************* @gmail.com said the following on 2/9/2006 5:17 PM:

Please quote what you are replying to.
Shiva did, at least I can see all of my post to which the user was
responding too.


Shiva did not quote anything. If you want to believe different, then
feel free to do so. But do so knowing that Shiva didn't quote anything.
Shiva, thank you for responding to a question that an individual posted
on the internet, namely and specifically me.
Are you as equally thankful for the useless response you got?
Randy, based on some of your responses, you seem to be somebody who is
intentionally looking to fight and argue.

If correcting garbage replies and asking people to honor Usenet, and
specifically comp.lang.javas cript, conventions makes me one
intentionally looking to fight and argue, then so be it. But the post I
replied to not only had convention problems, it contained no less than 5
inaccuracies in a post that was only 6 sentences long. Posts like that
that get left alone end up becoming urban legends because new people
will read it and think that XP blocks popups on webpages (it doesn't)
among the other 5 inaccuracies. And that post is better off corrected
than left alone.

But, I will give you a chance here. Did the suggestion of putting your
code on a web server change the behavior of the code? I bet it doesn't
change it one bit.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 14 '06 #7

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

Similar topics

7
2146
by: Peter Aitken | last post by:
I want to include a button that has rollover effects and also is a link to a page that will open in a new window. Here's the code I am using: <A HREF="javascript:window.open('email_me.htm','','scrollbars=0,menubar=0,heigh t=260,width=400,toolbar=0');" ONMOUSEOVER="changeImagesX('EmailMe_Layer_1', 'images/EmailMe_Layer-1-over.gif'); return true;" ONMOUSEOUT="changeImagesX('EmailMe_Layer_1', 'images/EmailMe_Layer-1.gif'); return true;">
3
1970
by: ReGenesis0 | last post by:
I'm trying to rewrite the existing window using javascript. This works fine in IE- but in Mozilla, after I call a window.open, Mozilla starts wandering around like an alshiemers patient and bumping into doors. Specificly, Mozilla seems to be losing my... functions. Or variables. Except, I've tried alerts with dummy variables, and it seems to find THEM just fine... Does Mozilla start unloading existing memory right after a...
2
2437
by: John Dalberg | last post by:
I have a closed box system which opens an html page. The page closes by the system. I have access to the html page. I added code to open a child window from this page. However when the parent window closes, the child closes too. Is there a way to keep the child window open? Yes keep it orphaned. -- John Dalberg
9
3457
by: Christopher Benson-Manica | last post by:
I have the following situation: Page A opens a window named 'foo'. Page A then reloads itself. Is there a way for the reloaded Page A to determine whether there is an open window named 'foo', *without* calling window.open? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
1
2237
by: Craig Smith | last post by:
How do you open a new window and closed the parent window. ie click on link and new window opens in place of original window. Is there some way of combing window.open and window.close ? Thanks for any advice.
2
1629
by: Jon | last post by:
I am writing an MDI app that uses a document manager class to keep track of opened child windows. I want the user to be able to close a child window, but then re-open the window from the "Window" menu if they want. What happens to the child window after it is closed? Even though my document manager maintains the instance of the child and displays the name in the menu, when I try to use the show() method or the activate() method on a...
1
3165
by: SPG | last post by:
Hi, We are seeing a strange memory leak in IE (6...any) with opening and closing windows using JS When you run the code below (Assuming you have another file called leak2.html) the process manager shows and increase of about 150K in mem. Then when you close the new popup down only 75K is cleared up. We noticed this when we have a very large XML DOM being loaded into a window, about 1meg big. When the window is closed on 500K is being...
7
5814
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed to be two techniques for earlier versions. But the window.opener='' ;window.close(); and the window.open('','_parent','') ;window.close(); techniques do not work for me. I.e., I still get confirmation message
6
2037
by: Howard Rifkin | last post by:
Hi, I my Javascript I popup an authentication window using the command; unamePasswdWindow = open("auth.html","","width=500,height=100"); This works fine in IE, and in Firefox 2.x on Windows and Linux, but the open() just returns a null in Firefox 1.5 on Tru64 Unix.
0
8851
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
8748
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
8531
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,...
0
8628
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7359
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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
5650
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
2754
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
1739
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.