jsp 页面点击事件后弹出DIV层代码

function deleteTaxpayInfo(taxpayers){
          window.message = '确认要删除纳税人吗?';
        window.taxpayersinfoIds = taxpayers;   
        window.titleText = '删除纳税人';
        var updateTaxpayerinfoUrl = ' /taxation/admin/report/deletetaxpayerinfo.jsp';               
        openDiv(updateTaxpayerinfoUrl, 251, 151);   
     }
   function openDiv(url){
           var obj=document.getElementById('deltaxpayerinfodiv');
        if(obj){
            obj.parentNode.removeChild(obj);
        }
        obj=document.createElement('script');
        obj.id='linesp';
        obj.language = 'javascript';
        obj.src=url;
        document.body.appendChild(obj);
    }
JSP中点击按钮弹模态框,可以使用Bootstrap框架中的Modal组件来实现。 首先,在JSP页面中引入Bootstrap的CSS和JS文件: ```html <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css"> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script> ``` 然后,在页面中添加一个按钮: ```html <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">打开模态框</button> ``` 其中,`data-toggle="modal"`表示点击按钮时弹模态框,`data-target="#exampleModal"`表示模态框的ID为exampleModal。 最后,在页面中添加模态框的HTML代码: ```html <div class="modal" tabindex="-1" role="dialog" id="exampleModal"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">模态框标题</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <p>模态框内容</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary">保存</button> </div> </div> </div> </div> ``` 在上述代码中,`id="exampleModal"`与按钮中的`data-target="#exampleModal"`对应,`class="modal"`表示这是一个模态框,`role="dialog"`表示角色为对话框。 点击按钮后,模态框就会弹,点击关闭按钮或者点击模态框外部区域都可以关闭模态框。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值