title: jQuery $(document).ready() issue - jQuery 1.7.2
body: <p>I have a page on which I am loading a select tag with options that I am getting from an ajax call to a service. It is working just fine and loading the select tag correctly. I only want this loading to happen once when the user first arrives at the page so I put the call to the function that does this inside the $(document).ready(function call. The problem that I am seeing is that when the user selects one of the options and then clicks a button under certain circumstances I pop a dialog (jQuery UI) telling them they need to take a certain action. The first time this happen and only the first time the selected option is getting reset somehow to the first option in the list. I ran in debug many times and discovered that if this is the first time on the page the selector is loaded on arrival at the page as is expected but if the dialog gets popped it is loaded again - only the first time - after that if the dialog gets popped the reload does not occur and all is well. The abbreviated code:</p>
  
  <pre><code>$(document).ready(function () {
      $.fn.LoadStuff();
  });
  
  jQuery.fn.LoadStuff = function () {
      //load up the select tag with options
  };
  </code></pre>
  
  <p><code>LoadStuff</code> does not get called anywhere else. selOffers is the select tag and dvConflict is the dialog. They are not sharing a common parent div.</p>
  
  <pre><code>&lt;select id="selOffers"&gt;&lt;/select&gt; 
  
  &lt;div id="dvConflict"&gt;&lt;div id="dvConflictMsg" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>jQuery for the dialog:</p>
  
  <pre><code>var optSave = {
  width: 400,
  modal: true,
  resizable: false,
  draggable: false,
  closeOnEscape: true,
  zIndex: 1320,
  buttons: [
      {
          text: 'Ok',
          click: function () {
              $(this).dialog('close');
          }
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <pre><code>$(".ui-dialog-titlebar").hide(); //Hides the title
  </code></pre>
  
  <p>$('#dvConflict').css('background', 'none'); //Takes out our custom background
  $('#dvConflict').dialog(optSave);</p>