SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,107
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post How do i compare returned by ajax request

    Hi, i have some problem, how do i compare the data returned by ajax ?

    Code:
       $.ajax{(
         type:'post',
         url: 'some.php',
         success: function(data){
            if(data=='ok')
               {
                   alert('you are ok');
             }
           else if(data=='sad'){
                 alert('you are sad');
          }
            else if(data=='mad')
               {
                alert('you are mad');
          }
        }
    )};
    million thanks in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use either strstr()
    or strpos()


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
  •