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

Detect popup window in IE6

I am using the following to detect if a popup window is already open.
I only want to open a new window if it does not exist or has been
closed.
<HTML>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
var myPage;
function openMyPage() {
if (!myPage || myPage.closed){
myPage=window.open("default.aspx", "_blank");
}
else {
alert("NFSL1 is already opened");
}
}
//-->
</script>

</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" onClick="openMyPage();" VALUE="open MyPage">
</FORM>
</BODY>
</HTML>
The code works correctly in Firefox, but IE6 opens a new window every
time.

Any ideas?

thanks,

Luis

Jun 13 '07 #1
3 5002
lr******@gmail.com wrote:
myPage=window.open("default.aspx", "_blank");
The second argument should be the name (myPage) not a target (_blank).
JW
Jun 13 '07 #2
Janwillem Borleffs said the following on 6/13/2007 4:48 PM:
lr******@gmail.com wrote:
> myPage=window.open("default.aspx", "_blank");

The second argument should be the name (myPage) not a target (_blank).
And it should be opening a window with the name of "_blank" - which it
is - but IE <gaspgets it right and opens a new blank window each time.

Solution: give it a different name other than _blank.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 13 '07 #3
Randy Webb wrote:
Janwillem Borleffs said the following on 6/13/2007 4:48 PM:
>lr******@gmail.com wrote:
>> myPage=window.open("default.aspx", "_blank");

The second argument should be the name (myPage) not a target (_blank).

And it should be opening a window with the name of "_blank" - which it
is - but IE <gaspgets it right and opens a new blank window each time.

Solution: give it a different name other than _blank.
Also, if you give the window a name the first time it is opened, you do
not have to bother testing to see if the window is still open. Just
request another new window using the same name and any existing window
with the requested name will get reused.

Roger
Jun 13 '07 #4

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

Similar topics

39
by: David Jubinville | last post by:
Hi All, I've run into a bit of an interesting problem with CSS and font DPI and would certainly welcome help. Problem: Page layout defined in CSS has font size issues (overlapping frames,...
2
by: Jake | last post by:
Hi, I have a page with a bunch of thumbnails that when clicked, open the full size image in a new window. They are all different sizes and its a bit unprofessional looking. I'd like to find a...
23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
2
by: NWx | last post by:
Hi, I have the following question: I have an app that uses user login/logout to identify users When user logon, I register logon time in a session variable When user logoff using the logout...
8
by: Luke Matuszewski | last post by:
I have read all posts about how to detect that url have changed to new page and trigger the event handler then eg. function aidLogout(evt) { if(evt) { /* maybe via analyse of evt object i can...
1
by: Jessica | last post by:
Hi, I'm sorry if this has been asked before. I'm a designer and occasional javascript hacker, not a javascript writer. I cannot believe I have spent over 4 hours searching for this on Google and...
3
by: topherknowles | last post by:
Hello, I have a number of links opening in a fixed window that certain users cannot access because they are on netscape 4.6 (I think this can handle the links and it is actually their ancient...
1
mageswar005
by: mageswar005 | last post by:
hi, how to detect yahoo popup blocker, in my site i open a popup window but some local pc yahoo popup blocker can control my popup window. how can i detect the popup blocker....
4
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.