www.webdeveloper.com
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2012
    Posts
    92

    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
    92
    nebermind; had a "}" in there somehow... not sure why.

  3. #3
    Join Date
    May 2006
    Location
    Russia, Rostov-on-Don
    Posts
    1,151
    var success = (data=="Login Successful!") ? 'login now...' : 'bad';
    alert(success);
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

Thread Information

Users Browsing this Thread

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

     

Bookmarks

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