我正在尝试使用jQuery在用户单击按钮时在页面上显示模式对话框。这是我以前从未做过的事情。看起来一切正常,除了我无法在对话框中看到内容,我无法弄清楚原因。
这是视图中的模态div:
$(document).ready(function () {
$("#activeStatusModal").dialog({
autoOpen: false,
title: 'Job Status',
modal: true
});
});
$("a.btn").click(function (event) {
//Prevent navigation to the jobs page.
event.stopPropagation();
var toggle = $(this);
var ids = toggle.attr("id").split("-");
var cid = ids[1]; //Customer ID
var job = ids[2]; //Job ID
if (toggle.val() == "Mark Inactive") {
$("#jobstatusactionh3").text("Job " + job + " is currently ACTIVE.");
$("#jobstatusactiontext").text("You can mark it as inactive by clicking Confirm. Marking a job inactive helps us know that you're done. You can always reactivate it.");
} else {
$("#jobstatusactionh3").text("Job " + job + " is currently INACTIVE.");
$("#jobstatusactiontext").text("You can reactivate it by clicking Confirm.");
}
$("#activeStatusModal").dialog({
buttons:
{
'Confirm': function () {
$.ajax({
url: "/Jobs/ToggleActive",
method: "POST",
data: { cid: cid, job: job },
dataType: "json",
success: function (data, status, jqxhr) {
}
});
$(this).dialog('close');
location.reload(true);
},
'Cancel': function () {
$(this).dialog('close');
}
}
});
$("#activeStatusModal").dialog("open");
});
} //end toggle active/inactive
这是与脚本部分相关的jQuery:
{{1}}
当我在本地运行并检查页面时,这就是我所看到的(注意文本已相应设置):
https://www.w3schools.com/html/html5_canvas.asp
为什么它看起来是空的?