www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] shorthand if statement

  1. #1
    Join Date
    Apr 2012
    Posts
    99

    resolved [RESOLVED] shorthand if statement

    How do I type this out so that it works?

    Code:
    var success = (data=="Login Successful!" ? alert('login now...') : alert('bad')); }

  2. #2
    Join Date
    Apr 2012
    Posts
    99
    nebermind; had a "}" in there somehow... not sure why.

  3. #3
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,637
    var success = (data=="Login Successful!") ? 'login now...' : 'bad';
    alert(success);
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles