如何解决BS5和ZeptoJS用于模态
我正在尝试在正在进行的项目中设置Bootstrap 5,现在将ZeptoJS用于AJAX和某些DOM控制。
我的主要问题是这个,此代码在BS4上能正常工作:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/E-wave112/myadmissionportalsite2.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g.,'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
它是我在项目上使用的任何形式的通用模态响应者。但是我无法在BS5上调用该模式。
IE:如果我正在发送电子邮件,则电子邮件已发送,页面上会按预期重新加载,但是没有状态/响应模态的信号。
有时我需要使用其他一些模式来打开和关闭它,所有这些模式都遵循相同的结构,对我来说就像一个魅力。
欢迎任何帮助!
编辑
我能够使它像这样工作,但是看起来不正确:
$(document).on('submit','.form-response',function(e)
{
e.preventDefault();
// -------------------------
var dataForm = $(this).serialize();
// -------------------------
$.ajax({
type: 'post',url: $(this).attr('action'),data: dataForm,beforeSend: function()
{
$('.form-contact').find(':input',':textarea',':button').prop('disabled',true);
// -------------------------
if(!$('.modal-response').length)
{
$('body').append('<div class="modal fade modal-response" tabindex="-1"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-body"><div class="media align-items-center"><div class="media-icon"></div><div class="media-body ml-2"></div></div></div></div></div></div>');
}
// -------------------------
$('.modal-body .media-icon').html('<i class="fas fa-spinner fa-spin fa-fw fa-2x text-blue"></i>');
$('.modal-body .media-body').html('Processando...');
// -------------------------
$('.modal-response').modal('show');
},success: function(response)
{
$('.modal-body .media-icon').html('<i class="fas fa-check-circle fa-fw fa-2x text-success"></i>');
$('.modal-body .media-body').html(response);
// -------------------------
setTimeout(function(){window.location.reload(true);},3000);
},error: function(data)
{
$('.form-contact').find(':input',false);
// -------------------------
$('.modal-body .media-icon').html('<i class="fas fa-exclamation-circle fa-fw fa-2x text-danger"></i>');
// -------------------------
if(data.responseText !== '')
{$('.modal-body .media-body').html(data.responseText);}
else
{$('.modal-body .media-body').html('Houve um erro desconhecido');}
}
})
});
有什么建议吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。