Global jQuery dialog variable not working properly
- by Ben Dauphinee
When I call the function, the dialog does work.
If I move the dialog construction into the showtimes_list function, everything works fine.
I thought that variables declared outside a function were global in context?
var dialog_list = $("<div></div>").dialog({
autoOpen: false,
modal: true,
height: 300, width: 720,
});
function showtimes_list(sid){
dialog_list.html("");
$.get("ajax_showtimes.php?sid="+sid, function(data){
dialog_list.html(data);
}
);
dialog_list.dialog("open");
}