3
I’m trying to implement a modal, but I’m not getting it open, someone could help me.
<script src="~/Scripts/jquery-2.2.0.js"></script>
<script type="text/javascript"src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" ></script>
$(document).ready(function () {
function fnOpenNormalDialog() {
$("#dialog-confirm").html("Confirm Dialog Box");
// Define the Dialog and its properties.
$("#dialog-confirm").dialog({
resizable: false,
modal: true,
title: "Modal",
height: 250,
width: 400,
buttons: {
"Yes": function () {
$(this).dialog('close');
callback(true);
},
"No": function () {
$(this).dialog('close');
callback(false);
}
}
});
}
$('#btnOpenDialog').click(fnOpenNormalDialog);
function callback(value) {
if (value) {
alert("Confirmed");
} else {
alert("Rejected");
}
}
});
html
<input type="button" id="btnOpenDialog" value="Open Confirm Dialog" />
<div id="dialog-confirm"></div>
is giving the following error:
Uncaught TypeError: $(...).dialog is not a function
I managed using css
– Paulo Henrique