load html via get and observe click events

load html via get and observe click events

hi there!

still have a problem with the following code:

  
  1. <ul>
  2. <li><a class="open-page" href="/somewhere.html">link1</a></li>
  3. <li><a class="open-page" href="/elsewhere.html">link2</a></li>
  4. </ul>
  5. <div id="container"></div>

  6. $(document).ready(function() {
  7. $('.open-page').click(function(e) {
  8. var url = $(this).attr('href');
  9. $.get(url, function(data) {
  10. $('#container').html(data);
  11. });
  12. return false;
  13. });
  14. });

i want to load HTML called by a click on an open-page element into the given container <div id="#container">

well, that works fine but does not for elements loaded into the div also 
having a open-page class.

i also tried to use .live() - nothing. the links where opened by the 
common way browser handle this anchors - follow the link ;)

how to handle these added elements?

thank you!