title: how to use if statment inside $.ajax( and check for string response?
body: <p>I am trying to do this simple compare inside ajax post request. I just want to check the post response for different string values but it never works. The popup function never get called even i know for sure that php response is string "mango"could you guys tell me what i am doing wrong here ?</p>
  
  <pre><code>$.ajax(
  {
      type: 'POST',
      url: './doit1.php',
  
  
       data: {
       title: 'test',
  
       },
       success: function (good)
       {
                //handle success
                if($(good) =='mango')
               {
                  popitup('./doit1.php?action=stop')
                  //alert(good)
               else if ($(good) =='orange')
               {
                   //do something
               }
               else
               {
                  //default action
               }
        },
        failure: function (bad)
        {
            //handle any errors
            alert(bad)
  
        }
  });
  
  
  function popitup(url) {
      newwindow=window.open(url,'name','height=200,width=150');
      if (window.focus) {newwindow.focus()}
      return false;
  }
  </code></pre>