[Javascript] Re: Javascript Digest, Vol 7, Issue 13

David Lovering dlovering at gazos.com
Sat Sep 20 09:05:46 CDT 2003


Indeed.  the snippet

if (myObject == null) { stuff }

should work in all instances, but only if "myObject" is previously known to
exist.  You really do get the most amazingly droll messages when you test
non-existent variables for values (even null).

There may be a robust version of JavaScript out there which is canny enough
to do the right thing with a non-existent object, and just assume its value
is null -- but I haven't seen it yet.

-- Dave Lovering

----- Original Message ----- 
From: "BEKIM BACAJ" <trojani2000 at hotmail.com>
To: <javascript at LaTech.edu>
Sent: Friday, September 19, 2003 9:23 PM
Subject: Re: [Javascript] Re: Javascript Digest, Vol 7, Issue 13


> If I remember well enough you can check for 'null' with the null word, it
is
> a reserved word in js., so I gues you don't even need to close it in
"null"
> when comparing or calling the object status, if(null){..then} else{
then...
>
> I repply on following lines:
> *******************************************
> the word "undefined" is a mistake(because i do not
> know how to check a null value on javascript).
> *******************************************
> if this is the only prob, than it might help
>
>
> >From: "andy susanto" <andy78 at centrin.net.id>
> >Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
> >To: <javascript at LaTech.edu>
> >Subject: [Javascript] Re: Javascript Digest, Vol 7, Issue 13
> >Date: Sat, 20 Sep 2003 03:31:36 +0700
> >
> >David Lovering,
> >
> >Thanks for your replay, i am try to enlightenment my code.
> >
> >my goal is i am trying to check if  "jml object" has a value or not.
> >
> >if  "jml object" has a value i must create Input Tag again after user
click
> >the button, just like that.
> >
> >the problem is when i try to check that value for "jml object" with
> >"function alertvalue(obj,idx)" i expecting value of idx is an object so i
> >am
> >use "eval function" and the word "undefined" is a mistake(because i do
not
> >know how to check a null value on javascript).
> >
> >i hope my this mail can be enlightenment
> >
> >TIA,
> >
> >andy
> >
> >
> >
> >
> >_______________________________________________
> >Javascript mailing list
> >Javascript at LaTech.edu
> >https://lists.LaTech.edu/mailman/listinfo/javascript
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list