title: Testing a static jsonp response
body: <p>I have no trouble making jsonp requests, however I'm unsure about setting up a web service to deliver responses in jsonp.</p>
  
  <p>First, does a server need to be configured in a certain way to allow jsonp requests, or does the page just have to have the response properly formatted?</p>
  
  <p>In my testing I have the following jsonp response from geonames.org (I've placed it a blank page on server/domain 1 with nothing else):</p>
  
  <pre><code>&lt;?php echo $_GET['callback'];?&gt;({"postalcodes":[{"adminName2":"Westchester","adminCode2":"119","postalcode":"10504","adminCode1":"NY","countryCode":"US","lng":-73.700942,"placeName":"Armonk","lat":41.136002,"adminName1":"New York"}]});
  </code></pre>
  
  <p>On server/domain 2 I'm making the following request:</p>
  
  <pre><code>$.ajax({
      // works when I make the call to geonames.org instead of domain1
      //url: 'http://www.geonames.org/postalCodeLookupJSON?postalcode=10504&amp;country=US&amp;callback=?',,
      url: 'http://www.domain1.com/test/jsonp.php?callback=?',
      success: function(data) {
          $('#test').html(data);
      },
  });
  </code></pre>
  
  <p>The call works when I place the files on the same server (either domain 1 or 2) and turn it into a regular json request.  What am I doing wrong?</p>
  
  <p>Just to clarify:  My question pertains to the page RECEIVING the request.  I know the request works when I make it to geonames.org, flickr, etc... apis.  However, I'm trying to set up a page to send a response.  In my example I just have a blank page with hard coded jsonp.  I'm not sure if I have to have some other headers on the page or have something enabled on my server.</p>