title: JQuery Colorbox Future Element Append
body: <p>I have an html that has a link:</p>
  
  <pre><code>&lt;a id="myLink" href="/aa.html" title="New Bangoo" class="bangoo"&gt;Bangoo&lt;/a&gt;
  </code></pre>
  
  <p>and I include a js file that has this lines:</p>
  
  <pre><code>$("#myLink").live('click', function() { 
  var typi = 'Ginga';       
      $("#typeList").append('&lt;option&gt;' + typi + '&lt;/option&gt;');        
  });
  </code></pre>
  
  <p><code>aa.html</code> has that:</p>
  
  <pre><code>&lt;label for="typeList"&gt;Type&lt;/label&gt;
  &lt;div&gt;
     &lt;select id="typeList"&gt;&lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><code>aa.html</code> opens on a colorbox. Everything is OK but I can not append types to select list. It has no elements when it finishes to open. It used to work but now not working. It may be because of js file tries to append to list before html loads?</p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>When I do that it works:</p>
  
  <pre><code>$("#myLink").live('click', function() { 
  alert('Wait Here!');
  var typi = 'Ginga';       
      $("#typeList").append('&lt;option&gt;' + typi + '&lt;/option&gt;');        
  });
  </code></pre>
  
  <p>When I alert anything it waits and at this time it has enough time to append  to select list. How can I sure that external link has loaded so I can start to append? </p>
  
  <p><strong>PS:</strong> My problem is that I am trying to append an HTML element that I load it after I click  <code>myLink</code>. <code>aa.html</code> doesn't place at dom at the beginning, I load it from an external source.</p>
  
  <p>After external page loads at screen it has no elements at select list. When I try to run same code from Firebug it adds options to select list and works. It means that code works but there is a timing and asynchronism problem that I want to append elements to a select list before it locates at dom tree. I should wait loading it and after that run my code.</p>