title: jquery update div as text input is modified
body: <p>So I have this text input in a form, and I want to update a div as the user types text in the text input.</p>
  
  <pre><code> &lt;p&gt;&lt;label for="movie_name"&gt;Film: &lt;/label&gt; &lt;input type="text" name="movie_name" class="required" onkeydown="changediv2(this.value)" /&gt;&lt;/p&gt;
  
   &lt;p&gt;&lt;div id="ajax_update"&gt;&lt;/div&gt;&lt;/p&gt;
  </code></pre>
  
  <p>My js method:</p>
  
  <pre><code>function changediv2(str) {
  $('#ajax_update').html(geturl('http://url/search/movie?query='+str));
  }
  </code></pre>
  
  <p>If I type in a browser <a href="http://url/search/movie?query=someString" rel="nofollow noreferrer">http://url/search/movie?query=someString</a>, I get some html displayed.
  But when I call it via this ajax call, nothing happens...</p>
  
  <p>My geturl method:</p>
  
  <pre><code>function geturl(addr) {
   var r = $.ajax({
    type: 'GET',
    url: addr,
    async: false
   }).responseText;
   return r;
  }
  </code></pre>
  
  <p>I cannot see what is wrong in there...</p>
  
  <p>Please help me! :)</p>