Chaining dialog and load on multiple link

Chaining dialog and load on multiple link

Hi ,
I have a page with diffĂ©rents links , all the links have an href attribute linked to a specific 
page.
I'm trying to open this page inside a dialog by clicking the link.

I tried something like that :
  1. $(document).ready(function(){


  2.   $('#dialogBox').dialog({
  3. bgiframe:true,
  4. autoOpen:false,
  5. height:400,
  6. modal:true
  7. });


  8. $('.linkCal').click(function(e){
  9. e.preventDefault();
  10. $('#dialogBox').load($(this).attr('href')).dialog('open');
  11. });
  12. });
But the dialog opens only once the first time i click a link. The other time i have an error like 
$('#dialogBox').... is not a function.
Nevertheless if i remove the load() call , the dialog opens anytime whatever the clicked link.

Any idea ?

Thanks