title: JQUERY .keyup Event Not Working Properly
body: <p>I have a jquerymobile site.  One of the pages has a search box with a .keyup event.</p>
  
  <p>When you start typing or press enter it triggers this event.</p>
  
  <p>If I get to this page from my homepage the triggers don't work.  If I'm on this page and i reload the page then the trigger works.  The site is all one file with different DIVs as pages.</p>
  
  <p>The only way it works is if I reload the page first.</p>
  
  <p>Any ideas? Thanks
  This is loaded in a header.</p>
  
  <pre><code>$(document).ready(function() {
              $.ajaxSetup ({  
                  cache: false  
              });  
  
  $("#gsearch").keyup(function(event) {
                  clearTimeout($.data(this, 'timer'));
                  var wait = setTimeout(gsearch, 600);
                  $(this).data('timer', wait);
              }); 
  
  
  
              function gsearch() {
                  var len = 0;
                  var searchdata = '';
                  searchdata = $("#gsearch").val();
                  len = searchdata.length;
                  if ( len &gt;= 2 ) {
                  //$("#gtemp").html("&lt;center&gt;&lt;img src='ajax-loader.gif'&gt;&lt;/center&gt;");
                  //$.mobile.pageLoading();
                      $.ajax({  
                           // code here
                  }
                      });
  
                  }
  
              } 
  </code></pre>
  
  <p>This is the search box</p>
  
  <pre><code>&lt;center&gt;
                  &lt;div align="center" style="padding:5px; text-align:center;"&gt;
                  &lt;input type="search" id="gsearch" value="" /&gt;
                  &lt;/div&gt;
              &lt;/center&gt;
  
              &lt;div  id="googleres"&gt;
  </code></pre>