title: jQuery autocomplete source parameter does not update
body: <p>I'm using the jQuery autocomplete script for a text input element but the problem is that the lang variable in the source URI doesn't update when the variable is updated.</p>
  
  <p>The value of lang is updated whenever I click on a radio input element and after that I type something in the text input element which then trigger the autocomplete code. Strangely enough it always uses the "en" value and not the updated value.</p>
  
  <p>Does anyone know a better approach or a fix for my code?</p>
  
  <p><strong>code:</strong></p>
  
  <pre><code>var lang = 'en';
  
  $('input[name="language"]').click(function()
  {
      lang= $(this).val();
  });
  
  $("#query").autocomplete({
      source: "domain.com/suggest.php?language=" + lang,
      minLength: 1
  });
  </code></pre>