Javascript ajax成功后,如何在模式上显示隐藏按钮?
在ajax成功后,我试图显示一个隐藏的按钮,但我没有做到。任何帮助都将不胜感激。谢谢你抽出时间Javascript ajax成功后,如何在模式上显示隐藏按钮?,javascript,jquery,html,ajax,Javascript,Jquery,Html,Ajax,在ajax成功后,我试图显示一个隐藏的按钮,但我没有做到。任何帮助都将不胜感激。谢谢你抽出时间 $.ajax({ url: url, type: 'POST', data: fd, success: function (data) { // alert(data); disable_enable_features('resetForm'); console.lo
$.ajax({
url: url,
type: 'POST',
data: fd,
success: function (data) {
// alert(data);
disable_enable_features('resetForm');
console.log(data);
$('.modal-title-message').html('');
$('.modal-body-message').html('Some text');
$('#closeModal').show();
$('#exampleModal').modal('show');
},
cache: false,
contentType: false,
processData: false,
timeout: 45000
});
接近
给按钮和id,然后:
$('#buttonId').show()代码>
更新:
其他选择:
$('#exampleButton').css("display", "none"); // for hide
$('#exampleButton').css("display", ""); // for show
然后,向按钮提供密码和id:
$('#buttonId').show()代码>
更新:
其他选择:
$('#exampleButton').css("display", "none"); // for hide
$('#exampleButton').css("display", ""); // for show
为按钮添加ID,等等“exampleButton”
然后,在成功之后,你要做:
$("#exampleButton").show()
更新将ID添加到按钮等“exampleButton”
然后,在成功之后,你要做:
$("#exampleButton").show()
更新你做了正确的事:
$('#closeModal').show(); //this correctly undoes your hide
你的问题可能来自其他地方,你确定你正在进入你的功能吗
您应该使用浏览器的调试控制台并设置断点。您做了正确的事情:
$('#closeModal').show(); //this correctly undoes your hide
你的问题可能来自其他地方,你确定你正在进入你的功能吗
您应该使用浏览器的调试控制台并设置断点。是的,我正在使用该函数。刚刚尝试了一个console.log,工作正常,但仍然无法显示按钮。是的,我正在进入该功能。刚刚尝试了一个console.log,工作正常,但仍然无法显示按钮。