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
FilipsFreelancerAsked:
Who is Participating?
 
ahosangFinance Systems DeveloperCommented:
if (!window.newwin||(window.newwin&&newwin.closed)) {
  newwin=window.open(...)
}
0
 
FilipsFreelancerAuthor Commented:
Short but good.

Thanks a lot ahosang.
Filips
0
 
ahosangFinance Systems DeveloperCommented:
glad to help :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.