title: Returning data is not working in jQuery using Ajax
body: <p>I have developed code with Ajax and jQuery. I have got a response from my.php, and I have
  tried to extract the values of the response. Here the code (HTML):</p>
  <h3>My.php</h3>
  <pre><code>?php
      echo '&lt;div id=&quot;title&quot;&gt;My Title &lt;/div&gt;';
      echo '&lt;div id=&quot;message&quot;&gt; My message &lt;/div&gt;';
  ?&gt;
  </code></pre>
  <p>I try to extract the title and message so my code is below.</p>
  <pre><code>    &lt;head&gt;
          &lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.2.6.js&quot;&gt;&lt;/script&gt;
          &lt;script type=&quot;text/javascript&quot;&gt;
              $(document).ready(function() {
                  alert(&quot;OK&quot;);
  
                  $.ajax({
                      type:&quot;POST&quot;,
                      url: &quot;my.php&quot;,
                      cache:false ,
                      success: function(data){
                          $(&quot;#response&quot;).html(data);
                          var $response = $(data);
                          var oneval = $response.find('#title').text();
                          var subval = $response.find('#message').text();
                          alert(oneval);
                      }
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id=&quot;response&quot;&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>...</p>
  <p>The problem is when I tried to alert, it is not working. What is wrong with this logic? Should I use another function to extract the title and message?</p>