How to call PHP RESTful web service call using AJAX?
<p>I have tried below code to call RESTful web service developed in PHP. When I alert the responseText the vale is none or empty. I don't know why please help me.</p>

<pre><code>function onDeviceReady()
{
    var ajax = new XMLHttpRequest();
    ajax.open("GET","http://burt.innoppldesigns.com/Webservice/collections/format/json",true);
    ajax.send();
    ajax.onreadystatechange=function()
    {
        if(ajax.readyState==4 &amp;&amp; (ajax.status==200 ||ajax.status==0))
        {
            alert(ajax.status);
            alert(ajax.responseText);
            var data = jQuery.parseJSON(ajax.responseText);
            var list='';                         
            for(i=0; i&lt;data.data.length; i++)
            {
                list+='&lt;div id="'+data.data[i].collection_id+'" name="'+data.data[i].collection_name+'"  class="coll_main"&gt;&lt;img src="'+data.data[i].collection_image_path+'" /&gt;&lt;div class="right_con"&gt;&lt;h1&gt;'+data.data[i].collection_name+'&lt;/h1&gt;&lt;p&gt;'+data.data[i].description+'&lt;/p&gt;&lt;/div&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;';
            }
            //alert(list);
            $('.coll_main_con').html(list);
        }
    }
}
</code></pre>
