Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Checking for undefined


Message #1 by "Chris Chaffee" <chris.chaffee@u...> on Thu, 10 May 2001 10:20:46 -0700
What is the correct way to check for undefined without causing the
browser to generate an error?

I have the following code, which works great under IE but Netscape
complains that 'item is undefined' (which is exactly what I want to
know, I just don't want it to error out and halt execution).

   with (document.frmUserEntry)
   {
      if (item('restSymbol') !=3D undefined)
         do
         {
   ...


The HTML for this page is generated dynamically by ASP, so I basically
just need to know whether or not this item exists on the page.  If it
exists, then I will continue processing it, otherwise I'll just skip it.

Thanks,

Chris Chaffee
Technology Engineer
UNX, Inc.
Member NASD/SIPC
175 E. Olive Ave., 2nd Fl.
Burbank, CA 91502
(xxx) xxx-xxxx  x317
chris@u...

The information contained in this communication is intended only for the
personal and confidential use of the designated recipients to which it
is
addressed. This communication may contain information that is
privileged,
confidential or otherwise protected from disclosure.  If the reader of
this
message is not the designated recipient, you are hereby notified that
you
have received this communication in error, and that any review,
dissemination, retention, distribution or copying of this communication
is
strictly prohibited.  If you have received this communication in error,
please notify us by telephone at  (xxx)xxx-xxxx  or by e-mail and discard
any
paper copies and/or delete all electronic files of this communication.

  Return to Index