Reply to Re: JavaScript: conditionally invoking functions within a function

Your name:

Reply:


Posted by Neredbojias on 09/30/05 16:58

With neither quill nor qualm, Spartanicus quothed:

> How should functions be invoked conditionally from within a function?
> This throws errors and doesn't work:
>
> function test() {
> if (0 == 0)
> {
> function foo();
> }
> if (1 == 1)
> {
> function bar();
> }
> }
>
> Minimized test case: http://homepage.ntlworld.com/spartanicus/temp.htm

You've basically got it right.

function test() {
if (a) {
foo();
} else {
if (b) bar();
}
}

--
Neredbojias
Contrary to popular belief, it is believable.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация