is this object empty, Javascript
<p>I have an ajax system set up.  When the MySQL query returns no data, I need it to pass an empty object back.  I create a node called 'data' in the php script and even when the query returns no data I pass $data['success'] = 1.</p>

<p>The trick is I can't figure out how to check to see if the query was returned data or not.</p>

<p>I have tried...</p>

<pre><code>// sub responseObj.data for responseObj.data[0] for the following if's
if(responseObj.data[0].length == -1)  

if(responseObj.data[0] == null)

if(responseObj == undefined)
//edit: added this...
if(!responseObj.data[0])
</code></pre>

<p>and I've really lost tack of any other various snippet's i've tried.</p>

<p><strong>EDIT: adding xml generated that is passed to my script</strong><br>
XML - returning zero results</p>

<pre><code>&lt;response_myCallbackFunction&gt;  
  &lt;success&gt;1&lt;/success&gt;  
&lt;response_myCallbackFunction&gt;
</code></pre>

<p>XML - returning a populated query  </p>

<pre><code>&lt;response_myCallbackFunction&gt;  
  &lt;data&gt; 
  &lt;random_data&gt;this is data&lt;/random_data&gt;  
  &lt;/data&gt;  
  &lt;success&gt;1&lt;/success&gt;  
&lt;response_myCallbackFunction&gt;
</code></pre>

<hr>

<p><strong>Is there a way to check to see if an object is empty in javascript?</strong></p>

<p>-thanks</p>
