<small id='FuYJp'></small><noframes id='FuYJp'>

  • <i id='FuYJp'><tr id='FuYJp'><dt id='FuYJp'><q id='FuYJp'><span id='FuYJp'><b id='FuYJp'><form id='FuYJp'><ins id='FuYJp'></ins><ul id='FuYJp'></ul><sub id='FuYJp'></sub></form><legend id='FuYJp'></legend><bdo id='FuYJp'><pre id='FuYJp'><center id='FuYJp'></center></pre></bdo></b><th id='FuYJp'></th></span></q></dt></tr></i><div id='FuYJp'><tfoot id='FuYJp'></tfoot><dl id='FuYJp'><fieldset id='FuYJp'></fieldset></dl></div>
      <bdo id='FuYJp'></bdo><ul id='FuYJp'></ul>

        <legend id='FuYJp'><style id='FuYJp'><dir id='FuYJp'><q id='FuYJp'></q></dir></style></legend>
        <tfoot id='FuYJp'></tfoot>

        如何创建带有“确定"和“取消"选项的对

        时间:2023-09-04
        <legend id='LS798'><style id='LS798'><dir id='LS798'><q id='LS798'></q></dir></style></legend>

        <i id='LS798'><tr id='LS798'><dt id='LS798'><q id='LS798'><span id='LS798'><b id='LS798'><form id='LS798'><ins id='LS798'></ins><ul id='LS798'></ul><sub id='LS798'></sub></form><legend id='LS798'></legend><bdo id='LS798'><pre id='LS798'><center id='LS798'></center></pre></bdo></b><th id='LS798'></th></span></q></dt></tr></i><div id='LS798'><tfoot id='LS798'></tfoot><dl id='LS798'><fieldset id='LS798'></fieldset></dl></div>

              • <bdo id='LS798'></bdo><ul id='LS798'></ul>
                  <tbody id='LS798'></tbody>
                  <tfoot id='LS798'></tfoot>

                  <small id='LS798'></small><noframes id='LS798'>

                  本文介绍了如何创建带有“确定"和“取消"选项的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我将制作一个按钮来执行操作并将数据保存到数据库中.

                  I am going to make a button to take an action and save the data into a database.

                  一旦用户单击按钮,我希望 JavaScript 警报提供是"和取消"选项.如果用户选择是",则将数据插入数据库,否则不执行任何操作.

                  Once the user clicks on the button, I want a JavaScript alert to offer "yes" and "cancel" options. If the user selects "yes", the data will be inserted into the database, otherwise no action will be taken.

                  如何显示这样的对话框?

                  How do I display such a dialog?

                  推荐答案

                  您可能正在寻找 confirm(),它会显示一个提示并返回 truefalse用户决定:

                  You’re probably looking for confirm(), which displays a prompt and returns true or false based on what the user decided:

                  if (confirm('Are you sure you want to save this thing into the database?')) {
                    // Save it!
                    console.log('Thing was saved to the database.');
                  } else {
                    // Do nothing!
                    console.log('Thing was not saved to the database.');
                  }

                  这篇关于如何创建带有“确定"和“取消"选项的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:elasticsearch 分析器 - 小写和空格标记器 下一篇:JavaScript 中的打开文件对话框

                  相关文章

                  最新文章

                1. <i id='d3Jiv'><tr id='d3Jiv'><dt id='d3Jiv'><q id='d3Jiv'><span id='d3Jiv'><b id='d3Jiv'><form id='d3Jiv'><ins id='d3Jiv'></ins><ul id='d3Jiv'></ul><sub id='d3Jiv'></sub></form><legend id='d3Jiv'></legend><bdo id='d3Jiv'><pre id='d3Jiv'><center id='d3Jiv'></center></pre></bdo></b><th id='d3Jiv'></th></span></q></dt></tr></i><div id='d3Jiv'><tfoot id='d3Jiv'></tfoot><dl id='d3Jiv'><fieldset id='d3Jiv'></fieldset></dl></div>

                      <small id='d3Jiv'></small><noframes id='d3Jiv'>

                      <tfoot id='d3Jiv'></tfoot>
                        <bdo id='d3Jiv'></bdo><ul id='d3Jiv'></ul>

                      <legend id='d3Jiv'><style id='d3Jiv'><dir id='d3Jiv'><q id='d3Jiv'></q></dir></style></legend>