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. ocPortal 9 is 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 :).

There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: