[thelist] exiting out of a function using a nested function
Tom Dell'Aringa
pixelmech at yahoo.com
Tue Jul 2 16:56:01 CDT 2002
Aaarrrgh! Why didn't I figure that... man, I *AM* the Charlie Brown
of web development.
Thanks James.
--- James Aylard <evolt at pixelwright.com> wrote:
> Tom,
>
> > I have a page where some data is being loaded. If that data is
> not
> > loaded, I have to stop execution of a function, but I cannot
> figure
> > out how to exit out...let me show ya (easier than explaining)
>
> Modifying your original script:
>
> function init()
> {
> if (!checkData()) // checking to see if the data is present
> {
> return false ; // will end only if checkData() is false
> }
> // otherwise, it will continue on with the other stuff...
> }
>
> function checkData()
> {
> if (the data is not there)
> {
> // hey, you have no data!
> return false ;
> }
> return true ;
> }
>
> James Aylard
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
More information about the thelist
mailing list