Issues with jQuery UI modal dialog.

Issues with jQuery UI modal dialog.

Hi,

I am using the modal dialog box to load an external page to return a movie file based on a URL variable.
First off, i am initialising the dialog box, like so:

trainingmovies/index.cfm
  1. <!--- Movie Popup --->
  2. <cfset variables.dialogBoxSettings =                 "{bgiframe:true,height:788,width:1020,modal:true,resizable:false,title:'Play Movie',draggable:false,autoOpen:false}">

  3. <div id="movieDiv" style="display:none;"></div>

  4. <script type="text/javascript" language="javascript">
    $(function(){
        $("#movieDiv").dialog(<cfoutput>#variables.dialogBoxSettings#</cfoutput>);
    })
    </script>




Then, on each link to a movie:
  1. <a href="Javascript:void(1);" onclick="$('#movieDiv').empty().load('/trainingmovies/movie.cfm?movie=management-reports').dialog('open'); return false">
This works fine, and returns and plays the movie fine, however whenever i close the dialog box (x in the top right) and then click that link again, i get the following error in firebug:
  1. $("#movieDiv").empty().load("/trainingmovies/movie.cfm?movie=management-reports").dialog is not a function
And no dialog box is open.

What am i doing wrong?

Thanks












    • Topic Participants

    • info