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

Help needed...js error

This is part of another quest for solution I've posted, but I'm getting no
responses.

My script is:

var popwin;
function launchwin(winurl,winname,winfeatures) {
if (popwin) {popwin.close();}
popwin = window.open(winurl,winname,winfeatures);
popwin.focus();
}

URL: http://www.edbj.itnava.com/brca.html

This works...to an extent. If the window launched is manually closed, and
then an attempt is made to re-open the window, the script fails with the
error: 'Type mismatch (usually a non-object value used where an object is
required) -- if (popwin).' The only way to re-use the function a second
time is to reload the page.

Help! Please... Thanks in advance.
--
Ed Jay (remove 'M' to respond by email)
Jul 27 '06 #1
1 1234
Ed Jay scribed:
>My script is:

var popwin;
function launchwin(winurl,winname,winfeatures) {
if (popwin) {popwin.close();}
popwin = window.open(winurl,winname,winfeatures);
popwin.focus();
}

This works...to an extent. If the window launched is manually closed, and
then an attempt is made to re-open the window, the script fails with the
error: 'Type mismatch (usually a non-object value used where an object is
required) -- if (popwin).' The only way to re-use the function a second
time is to reload the page.

Help! Please... Thanks in advance.
Solution: Use
try {popwin.close();} catch(e) {};
instead of
if (popwin) {popwin.close();}
--
Ed Jay (remove 'M' to respond by email)
Jul 29 '06 #2

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

Similar topics

28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
5
by: NG | last post by:
Hi, We are having DB2-V7.2 DB on AIX 5.2 machine. Recently we upgraded our system to fixpack 13 and activated activate AIX asynchronous IO function. Our DB is going to crash recovery with...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
4
by: cpptutor2000 | last post by:
I am trying to create a simple linked list. The source code is provided below. I receive the following error message: (Please see after source code). I have marked the lines where the error occurs...
3
by: DM | last post by:
newbie trying to set up a Database and keep getting the same result. ERROR An error occured while retrieving the information from the database: Unable to cast COM object of type...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
5
by: Hexman | last post by:
I've come up with an error which the solution eludes me. I get the error: >An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in HRTest.exe > >Additional...
1
by: teddymeu | last post by:
hi guys I posted the other day regarding a solution i needed to design, im new to development an asp,net and built a local post office search tool using asp.net 2. vb in visual studio, using an...
0
by: shantanuaggarwal | last post by:
Hi,, I have one following question that whether attributes can help me in resolving this problem: I have one base class called Employee and I have 3 classes which inherit it: EmployeeA...
1
by: janakivenk | last post by:
Hello, I am running Oracle 10g R2 in our office. I created the following procedure. It is suppose to access an xml file ( family.xml). The procedure is compiled and when I try to run it, i get the...
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
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
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,...
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
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...
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.