【发布时间】:2013-05-14 09:31:34
【问题描述】:
我有这个 Javascript,我想点击确定并在我的控制器中调用 detel 方法, 但它不工作,我不知道为什么。
我需要在此提交中输入两个值:id and name。
我也不知道应该是什么网址,因为方法没有改变。我现在正在删除,但在 get 方法中。
代码如下:
<script type="text/javascript">
$(function () {
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Ok": function () {
$.ajax({
type: "POST",
url: "",
data: { name: ViewBag.ProductName, id: ViewBag.ProductID },
success: function () {
alert("succes");
$("#result").html('submitted successfully');
},
error: function () {
alert("failure");
$("#result").html("there is error with submit");
}
})
$(this).dialog("close");
},
Anuluj: function () {
$(this).dialog("close");
}
}
});
});
</script>
【问题讨论】:
-
“Anuluj”是什么意思?
-
意思是cancle。但它仅用于关闭窗口。
标签: javascript ajax post model-view-controller