title: Not getting a response for an AJAX call to PHP (with JSON data)
body: <p>I have a PHP running on a server, and i call to it via <code>jQuery.Ajax()</code> but it always return to the error portion of it.</p>
  
  <p>If i call the PHP address directly from my browser, i get the response i need, it only breaks in the jQuery call.</p>
  
  <p>The PHP (simply saying) is this:</p>
  
  <pre><code>&lt;?php
  if(isset($_GET['getcodenode']))
  {
      echo json_encode
      (
          array
          (
              'itens'=&gt;
              array
              (
                  0=&gt;array('id'=&gt;100,'lb'=&gt;'300','ds'=&gt;'300 mm'),
                  1=&gt;array('id'=&gt;105,'lb'=&gt;'400','ds'=&gt;'400 mm')
              )
          )
      );
      die();
  }
  ?&gt;
  </code></pre>
  
  <p>And on the javascript side i call for it like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript"&gt;
              function loadcall(data)
              {
                  jQuery.ajax({
                      async:false,
                      method:'POST',
                      crossDomain:true,
                      dataType:'jsonp',
                      url:'http://example.com/ajax.php?getcodenode',
                      data:{'arg':data},
                      success:function(result){
                          var ret=JSON.parse(result);
                          var el=jQuery('#abc');
                          for(en in ret.itens)
                          {
                              el.Append('&lt;div id="item_'+en.id+'"&gt;'+en.lb+', '+en.ds+'&lt;/div&gt;');
                          }
                      },
                      error:function(result){alert('Error (loadcall)');}
                  });
              }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="abc"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>