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
- <!--- Movie Popup --->
- <cfset variables.dialogBoxSettings = "{bgiframe:true,height:788,width:1020,modal:true,resizable:false,title:'Play Movie',draggable:false,autoOpen:false}">
<div id="movieDiv" style="display:none;"></div>
<script type="text/javascript" language="javascript">
$(function(){
$("#movieDiv").dialog(<cfoutput>#variables.dialogBoxSettings#</cfoutput>);
})
</script>
Then, on each link to a movie:
- <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:
-
$("#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