title: retrieve json file from server
body: <p>I am trying to get a json file from my server. Until now, always I need a json file, it was got by ajax and a php file in server creates the json file. </p>
  
  <p>Not I have a json file (X.json) with this structure: </p>
  
  <pre><code>{
  "zona": [
      {
          "zona1": [
              {
                  "lon": "a",
                  "lat": "b"
              },
              {
                  "lon": "aa",
                  "lat": "bb"
              },
              {
                  "lon": "aaa",
                  "lat": "bbb"
              },
              {
                  "lon": "aaaa",
                  "lat": "bbbb"
              }
          ]
      },
      {
          "zona2": [
              {
                  "lon": "c",
                  "lat": "d"
              },
              {
                  "lon": "cc",
                  "lat": "dd"
              },
              {
                  "lon": "ccc",
                  "lat": "ddd"
              },
              {
                  "lon": "cccc",
                  "lat": "dddd"
              },
              {
                  "lon": "ccccc",
                  "lat": "ddddd"
              }
          ]
      }
  ]
  }
  </code></pre>
  
  <p>And when I try the same way to get the file, I didn't get anything. I think maybe it is possible to add the file when I load the webpage like a javascript file. Or maybe with jsonp but I trid and also I got bad answer.</p>
  
  <p>As json try, I used:</p>
  
  <pre><code>$.ajax({
          url: 'localhost/open/listaPuntosZona.json',
          type: 'GET',
          data: "{}",
          contentType: "application/json; charset=utf-8",
          dataType: "jsonp",
          jsonp: "callback",
          jsonpCallback: "jsonpCallbackfunction",
          error: function () {
              alert("Error in Jsonp");
          }
      });
  
  function jsonpCallbackfunction(responseData) {
  alert(responseData);    
  
  }
  </code></pre>
  
  <p>Also I wrapped json file with: callback( jsonfile code)</p>
  
  <p>And also, this other two tries:</p>
  
  <pre><code>$.ajax({ 
    url: 'localhost/open/listaPuntosZona.json', 
    type: 'get', 
    error: function(data){ }, 
    complete: function(data){ 
  
      data=jQuery.parseJSON(data); //do something with data
  
      alert(data.zona.zona1.length);
    }
  });
  
  
  
  $.getJSON('localhost/open/listaPuntosZona.json',function(jsonData){
      alert("hola");
      alert(jsonData);
  });
  </code></pre>
  
  <p>I am using lampp to test the webpage.</p>
  
  <p>Do I have to change something? I used jsonp in past but don't know what I am doing wrong now.</p>