title: How to send data to Flask via AJAX?
body: <p>I'm making small web project based on Flask. And I have to send some data to Flask, but I don't know how to do it. I tried different ways, tried to use JSON, but I don't know how to work with it. Maybe someone can share working piece of code with me or help by explaining what I have to do?</p>
  
  <pre><code>new_freq = $('#input').val() //value I want to send 
  $.ajax({ 
      url: '/set_freq', 
      type: 'POST', 
      data: ,
      success: function(response){ 
          $('#main').text(response) 
      } 
  })
  </code></pre>