gpt4 book ai didi

javascript - 如何在不单击按钮的情况下打开 Bootstrap 模式?

转载 作者:太空狗 更新时间:2023-10-29 13:06:38 26 4
gpt4 key购买 nike

<分区>

我需要在我的页面中的 ajax 成功功能中弹出一个 Bootstrap 模式。提交表单时调用成功功能..,那么有什么方法可以在不单击按钮的情况下弹出 Bootstrap 模式。我'我是菜鸟..,请帮帮我..这是我的 ajax 调用..

     $("#form").submit(function(e)
{
$.ajaxSetup({
headers:{'X-CSRF-Token' : $('meta[name=_token]').attr('content')}
});
e.preventDefault(); //STOP default action
var postData = $(this).serializeArray();
console.log(postData);


var formURL = "http://localhost:8000/v1/people_roles";

$.ajax(
{


url :formURL ,
type: "POST",
data : postData,
success:function(response, textStatus, jqXHR)
{

if(response.parent==1)
{
$("#getCode").html(response);
$("#getCodeModal").modal('show');
window.location.href="/web/staff/detail.php?id="+response.people_id;
}
else
{
//console.log(response);
window.location.href="/web/staff/detail.php?id="+response.people_id;
}
}



});
});

这是我的 html 模态代码..

    <div class="modal fade" id="getCodeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p><strong>Lorem Ipsum is simply dummy</strong> text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown
printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" ng-click="cancel()">Close</button>
<button type="button" class="btn btn-primary" ng-click="ok()">Save changes</button>
</div>
</div>
</div>
</div>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com