What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » AJAX isn't working

AJAX isn't working
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: AJAX isn't working
quote:
Originally posted by CookieRevised
But this was exactly because he did not nested the IF structure between { }. So reading and debugging made easier if you don't nest stuff? I dont think so... it's more confusing and mistakes happen more quickly, especially when you split things out on several lines. (and reading other scripting topics, such mistakes happen all the time)...

I agree it can be harder to read if you omit the braces, but what I meant was, for example, the difference between these two code blocks:

js code:
if(functionA()) {
    if(functionB()) {
        // do something
    }
    else {
        // handle error b
    }
}
else {
    // handle error a
}

// ==========

if(!functionA()) {
    // handle error a
    return;
}
if(!functionB()) {
    // handle error b
    return;
}

// do something

It keeps everything together nicely imo, with the error handling right next to the error. Obviously it might not always be applicable, and everything is open to argument :P

[/off-topic]
08-30-2010 10:35 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
AJAX isn't working - by The-Phantom on 08-28-2010 at 01:33 PM
RE: AJAX isn't working - by V@no on 08-29-2010 at 05:31 AM
RE: AJAX isn't working - by The-Phantom on 08-29-2010 at 07:09 AM
RE: AJAX isn't working - by Matti on 08-29-2010 at 07:10 PM
RE: AJAX isn't working - by The-Phantom on 08-29-2010 at 07:57 PM
RE: AJAX isn't working - by CookieRevised on 08-29-2010 at 08:24 PM
RE: AJAX isn't working - by Matti on 08-29-2010 at 08:43 PM
RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 06:48 AM
RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 08:31 AM
RE: RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 08:40 AM
RE: RE: RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 09:01 AM
RE: RE: RE: RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 09:22 AM
RE: AJAX isn't working - by Eljay on 08-30-2010 at 09:41 AM
RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 10:12 AM
RE: AJAX isn't working - by Eljay on 08-30-2010 at 10:35 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On