Solved

Prevent or hide javascript error

Posted on 2001-07-26
3
183 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why is initialize not a function? 8 50
jQuery Datatables.js Selecting a Row to get ID 5 36
Validating Date 4 28
Html date format 9 20
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

680 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