File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes what is this 'if' condition? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "what is this Watch "what is this New topic
Author

what is this 'if' condition?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830


This JS code disabled 'button' if 'contentarea' is empty and enabled if 'contentarea' is not empty.

What I didn't get is, this condition:

if (document.all || document.getElementById)
setInterval("checkifempty()",100)



Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
whoever wrote that code did not know what event handlers are and wrote a loop that keeps calling the function. Very poorly designed.

Eric
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Eric Pascarello:
whoever wrote that code did not know what event handlers are and wrote a loop that keeps calling the function. Very poorly designed.

Eric


http://www.javascriptkit.com/javatutors/deform4.shtml

I copied code from above link.

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
and everything you find on the net is good?

Using intervals is bad when you have a better option such as blur. No wasted memory.

Eric
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

onBlur would be a better idea.

- manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is this 'if' condition?
 
Similar Threads
How to disable "open in new window" in IE
'please wait' message while jsp is loading
Loading Progress Bar
Hide form elements in Netscape4.7
World Clock Problem