HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Funny little code optimisation (#news_170) - Comments

Login / Search

 [ Join | More ]

Funny little code optimisation

Posted 09 August 2009, 12:53 AM
I'm in the middle of reviewing a developers code. This amused me…


      var url='';
         if (filename!='')

because it is exactly equivalent in behaviour to…

Read more

Ain't quite optimized yet.

Optimization would be when you can avoid the second evaluation of "document.getElementById('file'+number)":

      var url=filename;
      var obj=document.getElementById('file'+number);

Very true :).

1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: