title: POST 500 (Internal Server Error)
body: <p>I'm working on a Python app that uses jQuery to smart-select districts when the correct city is selected and cities when the correct country is selected, so visitors need not refresh their browser.</p>
  
  <p>I get this error on Chrome console:</p>
  
  <blockquote>
    <p>POST [Localhost url] 500 (Internal Server Error) </p>
  </blockquote>
  
  <p>Here is my testing code:</p>
  
  <pre><code>   &lt;header&gt;
        &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" /&gt; 
        &lt;script&gt;
           function selectCountry(){
              $.ajax({
                 type: 'POST',
                 url: '/',
                 data: 'countrySelect=1',
  
              });
              console.log(events);
           }
  
        &lt;/script&gt;
     &lt;/header&gt;
  
     &lt;body&gt;
        &lt;script&gt;
           var var1 = $_POST('countrySelect');
           document.write(var1);
        &lt;/script&gt;
  
        &lt;select onchange="javascript:selectCountry()"&gt;
           &lt;option name="" value=""&gt;country a&lt;/option&gt;
           &lt;option name="" value=""&gt;country b&lt;/option&gt;
        &lt;/select&gt;
    &lt;/body&gt;
  </code></pre>
  
  <p>Changing to <code>GET</code> works fine but doesn't show the variables on the navigation bar. </p>
  
  <p>Can anyone help?</p>
  
  <p>Thanks in advance.</p>