我想显示是,没有按钮而不是确定并取消以下代码 [英] I want to show yes, no button instead of OK and cancel for the below code
本文介绍了我想显示是,没有按钮而不是确定并取消以下代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$(document).ready(function(){
$(#LogOut1)。click(function(e){
//使用任何确认你想要的盒子
if(!window.confirm(你确定要退出吗?)){
e.preventDefault();
}
});
});
我尝试了什么:
我在ASP.Net MVC中尝试过。但无法修复它。请任何人帮助我。
解决方案
(#LogOut1)。点击(功能(e){
//使用任何确认你想要的盒子
if(!window.confirm(你确定要退出吗?)){
e.preventDefault();
}
});
});
我尝试了什么:
我在ASP.Net MVC中尝试过。但无法修复它。请任何人帮助我。
这些对话框已修复,您无法更改它们。如果你想要一个带有不同按钮的对话框,你需要自己编写,或者使用像jQueryUI那样有对话框功能,或google for js对话框,你会发现很多插件可以用来实现这个目的
$(document).ready(function () {
$("#LogOut1").click(function (e) {
// use whatever confirm box you want here
if (!window.confirm("Are you sure you want to logout?")) {
e.preventDefault();
}
});
});
What I have tried:
I tried in ASP.Net MVC. But can't fix it. Please anyone help me out.
解决方案
("#LogOut1").click(function (e) {
// use whatever confirm box you want here
if (!window.confirm("Are you sure you want to logout?")) {
e.preventDefault();
}
});
});
What I have tried:
I tried in ASP.Net MVC. But can't fix it. Please anyone help me out.
Those dialogs are fixed, you can't change them. If you want a dialog with different buttons you'll need to write your own, or use something like jQueryUI that has a dialog feature, or google for js dialog boxes and you'll find lots of plug-ins you can use to achieve this.
这篇关于我想显示是,没有按钮而不是确定并取消以下代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文