Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
toastr javascript语法错误_Javascript - Fatal编程技术网

toastr javascript语法错误

toastr javascript语法错误,javascript,Javascript,我正试图实现一个带有是或否按钮的toastr 我明白了 SyntaxError:在参数列表之后缺少) 这是我的JavaScript代码: <script type="text/javascript"> function detele() { toastr.warning("<div>confirmer la suppression?</div>" + "<div class ='btn-group pull-r

我正试图实现一个带有是或否按钮的toastr

我明白了

SyntaxError:在参数列表之后缺少)

这是我的JavaScript代码:

<script type="text/javascript">
    function detele() {
        toastr.warning("<div>confirmer la suppression?</div>" +
          "<div class ='btn-group pull-right'> " +
          "<button type ='button' id='confirmationYes' class ='btn btn-xs btn-primary'><i class='glyphicon glyphicon-ok'></i>Oui</button>" +
          "<button type ='button' class ='btn btn-xs btn-default clear'><i class='glyphicon glyphicon-remove'></i>Non</button>" +
          "</div>", 
          "DeleteConfirmation", 
          {
            allowHtml: true,
            closeButton: true,
            onShown: function() {
              $("#confirmationYes").click(function() {
                  toastr.success("Done");
                });
              }
          });
        };
    </script> 

函数detele(){
toastr.警告(“确认人la抑制?”+
" " +
“是的”+
“非”+
"", 
“删除确认”,
{
allowHtml:是的,
关闭按钮:对,
onShown:function(){
$(“#确认是”)。单击(函数(){
成功(“完成”);
});
}
});
};
控制台显示错误在这一行

“”+
我就是不明白


您缺少一个括号

<script type="text/javascript">
  function detele() {
    toastr.warning("<div>confirmer la suppression?</div>" +
      "<div class ='btn-group pull-right'> " +
      "<button type ='button' id='confirmationYes' class ='btn btn-xs btn-primary'><i class='glyphicon glyphicon-ok'></i>Oui</button>" +
      "<button type ='button' class ='btn btn-xs btn-default clear'><i class='glyphicon glyphicon-remove'></i>Non</button>" +
      "</div>", 
      "DeleteConfirmation", 
      {
        allowHtml: true,
        closeButton: true,
        onShown: function() {
          $("#confirmationYes").click(function() {
              toastr.success("Done");
            });
          }
        };
      )};
</script>

函数detele(){
toastr.警告(“确认人la抑制?”+
" " +
“是的”+
“非”+
"", 
“删除确认”,
{
allowHtml:是的,
关闭按钮:对,
onShown:function(){
$(“#确认是”)。单击(函数(){
成功(“完成”);
});
}
};
)};
请注意,在您的中,.click(function(){没有右括号。
下次发布之前,请确保检查所有空缺是否已关闭。

您忘记关闭删除和打开功能。请尝试此代码

<script type="text/javascript">
    function detele() {
        toastr.warning("<div>confirmer la suppression?</div>" +
          "<div class ='btn-group pull-right'> " +
          "<button type ='button' id='confirmationYes' class ='btn btn-xs btn-primary'><i class='glyphicon glyphicon-ok'></i>Oui</button>" +
          "<button type ='button' class ='btn btn-xs btn-default clear'><i class='glyphicon glyphicon-remove'></i>Non</button>" +
          "</div>", 
          "DeleteConfirmation", 
          {
            allowHtml: true,
            closeButton: true,
            onShown: function() {
              $("#confirmationYes").click(function() {
                  toastr.success("Done");
                });
              };
          });
        };
    </script>

函数detele(){
toastr.警告(“确认人la抑制?”+
" " +
“是的”+
“非”+
"", 
“删除确认”,
{
allowHtml:是的,
关闭按钮:对,
onShown:function(){
$(“#确认是”)。单击(函数(){
成功(“完成”);
});
};
});
};

您在结尾处完全弄乱了结束括号(没有解释丢失的
但是“控制台显示错误在这一行”您在那句话后对那一行的引用使用了不同的(而且不正确)引用代码中的引号。您的代码有一些问题,第一个是不均匀的缩进。这使得很难看到括号排列在哪里。我已经自由地清理了它;希望您现在可以在祝酒词中发现额外的括号。缺少)。我希望您能帮助我@Mikemcaughan!谢谢您的帮助,但我仍然是得到相同的错误!试试看,我交换了两个顺序错误的。另外,你的闭括号数量也错误;你需要4个,而你只有3个。你能提供你正在尝试使用的源代码,以便我可以使它工作吗?不幸的是,我仍然得到相同的错误
<script type="text/javascript">
    function detele() {
        toastr.warning("<div>confirmer la suppression?</div>" +
          "<div class ='btn-group pull-right'> " +
          "<button type ='button' id='confirmationYes' class ='btn btn-xs btn-primary'><i class='glyphicon glyphicon-ok'></i>Oui</button>" +
          "<button type ='button' class ='btn btn-xs btn-default clear'><i class='glyphicon glyphicon-remove'></i>Non</button>" +
          "</div>", 
          "DeleteConfirmation", 
          {
            allowHtml: true,
            closeButton: true,
            onShown: function() {
              $("#confirmationYes").click(function() {
                  toastr.success("Done");
                });
              };
          });
        };
    </script>