Prevent or hide javascript error

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
LVL 6
FilipsAsked:
Who is Participating?
 
ahosangConnect With a Mentor Commented:
if (!window.newwin||(window.newwin&&newwin.closed)) {
  newwin=window.open(...)
}
0
 
FilipsAuthor Commented:
Short but good.

Thanks a lot ahosang.
Filips
0
 
ahosangCommented:
glad to help :-)
0
All Courses

From novice to tech pro — start learning today.