Javascript 确认后如何修改代码删除项目?
在我确认之前,我的代码将删除项目。在我确认项目后,如何进行更改以使其删除项目。下面是javascript代码:Javascript 确认后如何修改代码删除项目?,javascript,c#,confirm,Javascript,C#,Confirm,在我确认之前,我的代码将删除项目。在我确认项目后,如何进行更改以使其删除项目。下面是javascript代码: <script type="text/javascript"> var _source; var _popup; function showChild_Delete(source) { this._source = source; this._popup = $find('popupChild_Delete');
<script type="text/javascript">
var _source;
var _popup;
function showChild_Delete(source) {
this._source = source;
this._popup = $find('popupChild_Delete');
this._popup.show();
}
function btnChild_Delete_Click() {
this._popup.hide();
__doPostBack(this._source.name, '');
}
</script>
我将非常感谢您的帮助。您可能希望在客户端用javascript做一些事情,提示他们在做决定之前接受他们的决定
function btnChild_Delete_Click() {
if (!confirm('Are you sure you want to delete?')) return;
this._popup.hide();
__doPostBack(this._source.name, '');
}
<script type="text/javascript">
function btnChild_Delete_Click() {
this._popup.hide();
// the _doPostBack is triggering the delete. simply writing something here.
if (!confirm('Are you sure?')) return;
__doPostBack(this._source.name, '');
}
</script>
function buttonConfirmDelete_Click {
// 1. display the confirmation box.
}
function buttonDoDelete_Click {
__doPostBack(this._source.name, '');
// 2. hide the confirmation box.
}
这就回答了你的问题吗?你可能想在客户端用javascript做一些事情,提示他们在做决定之前接受他们的决定
<script type="text/javascript">
function btnChild_Delete_Click() {
this._popup.hide();
// the _doPostBack is triggering the delete. simply writing something here.
if (!confirm('Are you sure?')) return;
__doPostBack(this._source.name, '');
}
</script>
function buttonConfirmDelete_Click {
// 1. display the confirmation box.
}
function buttonDoDelete_Click {
__doPostBack(this._source.name, '');
// 2. hide the confirmation box.
}
您可以将它调整为您正在使用的任何javascript库。Hi。谢谢你的回复。它的作品,但给浏览器的窗口,这是不同的风格与我的网站。比如窗口的标题、颜色、大小。如何解决这个问题?我建议在代码中的某个地方为确认面板创建一个
DIV
,这样您就可以像其他HTML元素一样使用CSS对其进行样式化。只需更改该行即可显示弹出窗口并获得用户响应。Hi。谢谢你的回复。它的作品,但给浏览器的窗口,这是不同的风格与我的网站。比如窗口的标题、颜色、大小。如何解决这个问题?我建议在代码中的某个地方为确认面板创建一个DIV
,这样您就可以像其他HTML元素一样使用CSS对其进行样式化。只需更改该行即可显示弹出窗口并获得用户响应。
function buttonConfirmDelete_Click {
// 1. display the confirmation box.
}
function buttonDoDelete_Click {
__doPostBack(this._source.name, '');
// 2. hide the confirmation box.
}