[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Prevent or hide javascript error

Posted on 2001-07-26
3
Medium Priority
?
191 Views
Last Modified: 2010-08-05
Hi,

How can I prevent error messages showing on the statusbar of the browser?

I have an object (newwin = window.open(...)) that is only created by clicking a button but there is always a check to see is newwin is already open.

So when I enter the page, newwin is not existing and javascript check shows me the error in the statusbar saying: 'newwin' is undefined.

How can I hide or even prevent that error?

Thanks in advance.
Filips
0
Comment
Question by:Filips
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
ahosang earned 400 total points
ID: 6322725
if (!window.newwin||(window.newwin&&newwin.closed)) {
  newwin=window.open(...)
}
0
 
LVL 6

Author Comment

by:Filips
ID: 6322860
Short but good.

Thanks a lot ahosang.
Filips
0
 
LVL 12

Expert Comment

by:ahosang
ID: 6322882
glad to help :-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question