title: How to get OSM data using Overpass API from jQuery?
body: <p>I have the following code for requesting map data from OSM:</p>
  
  <pre><code>$.ajax({
      url:
          'https://www.overpass-api.de/api/interpreter?' + 
          '[out:json][timeout:60];' + 
          'area["boundary"~"administrative"]["name"~"Berlin"];' + 
          'node(area)["amenity"~"school"];' + 
          'out;',
      dataType: 'json',
      type: 'GET',
      async: true,
      crossDomain: true
  }).done(function() {
      console.log( "second success" );
  }).fail(function(error) {
      console.log(error);
      console.log( "error" );
  }).always(function() {
      console.log( "complete" );
  });
  </code></pre>
  
  <p>When I test the request on Overpass Turbo, it runs without any issues, but when preforming this request in a JavaScript, I always get the error:</p>
  
  <pre><code>"&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;&lt;head&gt;  &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/&gt;  &lt;title&gt;OSM3S Response&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.&lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Key expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: '!', '~', '=', '!=', or ']'  expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Value expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: ',' or ']' expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Key expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: '!', '~', '=', '!=', or ']'  expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Value expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: ',' or ']' expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: static error: For the attribute "k" of the element "has-kv" the only allowed values are non-empty strings. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: static error: For the attribute "k" of the element "has-kv" the only allowed values are non-empty strings. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Key expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: '!', '~', '=', '!=', or ']'  expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: Value expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: parse error: ',' or ']' expected - '%' found. &lt;/p&gt;&lt;p&gt;&lt;strong style="color:#FF0000"&gt;Error&lt;/strong&gt;: line 1: static error: For the attribute "k" of the element "has-kv" the only allowed values are non-empty strings. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"
  </code></pre>
  
  <p>There must be something wrong with the way I do the request, but I cannot figure out what could be wrong with it.</p>
  
  <p>How do I get the positions of all schools in Berlin from a JavaScript?</p>
  
  <p>I also tried using <code>$.getJSON()</code> but that didn't work for me either.</p>