need help with script

need help with script

I get this error
Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'



Here is my hrtml


  1. <!DOCTYPE htm
  2. l PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6.     <title>Expand table rows with jQuery - jExpand plugin - JankoAtWarpSpeed demos</title>
  7.     <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
  8. <link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.10.3.custom.min.css">
  9. <script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
  10. </head>
  11. <body>
  12. <a href="#" wicket:id="deleteLink" id="deleteLink52" onclick="
  13.             $('body').append('<div id='+'confirm-dialog'+'><div/>');
  14.     $('#confirm-dialog').dialog({
  15. show: 'fade',
  16. hide: 'fade',
  17. modal: true,
  18. height: 100,
  19. title: 'Some title',
  20. buttons: {
  21. OK: function() {
  22. $('#confirm-dialog').dialog('close');
  23. $('body').remove('#confirm-dialog');
  24. },
  25. Cancel: function() {
  26.   $('#confirm-dialog').dialog('close');
  27.   $('body').remove('#confirm-dialog');
  28. }
  29. }
  30. });
  31. $('#confirm-dialog').dialog('open');
  32. ">Delete</a>
  33. </body>
  34. </html>
please advice what is wrong here.It works for first click and then gives this error Please advice.