我目前正在从 mysql 数据库加载数据 - 如果满足某个条件,则会显示一个志愿者按钮。单击按钮时,我想显示一个对话框,并调用一个 php 文件来填充该框。首先我初始化对话框:
$(document).ready(function() {
$("#chaincrewDialog").dialog({ autoOpen: false });
});
这是我调用对话框的方式:
$('.volunteer').live("click", function(){
// this gets the game number from the table to pass to the php file
var gameno=$(this).parent('td').prev("td").prev("td").prev("td").prev("td").prev("td").html();
$('#chaincrewDialog').dialog('open').load("popup.php?gameno="+gameno);
});
我的点击按钮工作正常,并且没有 js 或 firebug 错误消息。使用以下参数调用我的对话框:
$(function() {
$('#chaincrewDialog').dialog({
resizable: true,
autoOpen: false,
resizable: false,
modal: true,
dialogClass: 'flora',
title: 'Volunteer',
overlay: {
opacity: 0.5,
background: "#A8A8A8"
},
height: 600,
width: 700,
buttons: {
'Close': function() {
$(this).dialog('remove')
}
}
});
我确定我错过了一些简单的东西,但我什至无法显示我的对话框......