title: Using netbeans 6.9 to debug ajax/xmlhttprequest and php
body: <p>I am using netbeans 6.9 and use xdebug to step through my php file which is great. however, I have been using ajax/xmlhttprequest in my project and i have a hard time debugging that. i did some research and came across firebug/firephp and read through a little. i am not against learning new tools but if it can be integrated into the ide i am currently using, it will be more efficient and effective.</p>
  
  <p>so, to provide more example, suppose on my index.php i have this:</p>
  
  <pre><code>&lt;button onclick="getTweet()"&gt;Get Tweets!&lt;/button&gt;
  </code></pre>
  
  <p>the getTweet() function reside in a .js file</p>
  
  <pre><code>function getTweet(){
      var xmlhttp = new XMLHttpRequest();
      xmlhttp.onreadystatechange = function(){
          if(xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200){
               // do something here
          }
      }
      xmlhttp.open("GET", "getTweet.php?q="+$phpVars,true);
      xmlhttp.send();
  }
  </code></pre>
  
  <p>getTweet.php goes out and does a twitter search:</p>
  
  <pre><code>$search = "http://search.twitter.com/search.atom?q=" . $q . "";
  $tw = curl_init();
  curl_setopt($tw, CURLOPT_URL, $search);
  curl_setopt($tw, CURLOPT_RETURNTRANSFER, TRUE);
  $twi = curl_exec($tw);
  $search_res = new SimpleXMLElement($twi);
  </code></pre>
  
  <p>Now, i am new to web development, php, js, ajax, html, xml, json, netbeans. I literally am learning all of this in the past 3.5 months so i'm new and need clear instructions. </p>
  
  <p>In getTweet.php, i can insert breakpoints in netbeans BUT...when i click the html button which triggers getTweet() from .js file which makes a xmlhttprequest, the debugger in netbeans does not trigger. Being able to see the variables and its outputs (XML, JSON, etc...) helped me tremendously in learning this stuff so I would like to be ale to see vars in getTweet.php such as $twi,$search_res,etc...</p>
  
  <p>Thanks for the advice!!!</p>
  
  <p>PS: Will firebug work for what I am trying to achieve? I am learning slowly and don't want to pile up too many things at once. Thanks!</p>