unable to view dialog after loading html and clicking again

unable to view dialog after loading html and clicking again

Hello,

I'm trying to set up dynamic dialogs based on the click of specific links.  For example, when the link with the id of 'link1' is clicked, content from an html page is loaded into the dialog div and then the dialog is displayed.  This works once, but when i close the dialog and click the link again, I get nothing.  How can I ensure that when i load content from an html file, this will work properly everytime it's clicked?  I'm obviously not doing something correctly here.

Thanks in advance for your assistance.

  1. $('#dialog')
  2. .dialog({
  3. autoOpen: false,
  4. title: 'Are you sure?',
  5. modal: true,
  6. resizable: false,
  7. height: 100,
  8. width: 600
  9. });

  10. $('#link1').click(function() {
  11. $('#dialog').load('test/test.html');
  12. $('#dialog').dialog('open');
  13. return false;
  14. });