【问题标题】:toastr message box appears but without texttoastr 消息框出现但没有文字
【发布时间】:2015-06-06 15:44:18
【问题描述】:

我有以下代码:

<script>
    $(function () {
        Command: toastr["success"]("My name is Inigo Montoya. You killed my father. Prepare to die!")
    });
</script>

该框显示,但它是空白的,并且其中没有文本。我该如何解决?我尝试添加以下上述命令:

    toastr.options = {
      "closeButton": true,
      "debug": false,
      "newestOnTop": false,
      "progressBar": false,
      "positionClass": "toast-top-center",
      "preventDuplicates": false,
      "onclick": null,
      "showDuration": "300",
      "hideDuration": "1000",
      "timeOut": "5000",
      "extendedTimeOut": "1000",
      "showEasing": "swing",
      "hideEasing": "linear",
      "showMethod": "fadeIn",
      "hideMethod": "fadeOut"
    }

但它所做的只是使盒子居中。如何让文本出现?

【问题讨论】:

  • 删除Command:部分
  • 谢谢,试过了,还是没有显示文字
  • 你有什么错误吗?
  • 无。如果我检查元素,控制台中不会显示任何内容。
  • 如果你删除命令你的代码完全没问题,请确保你的代码在jquery和toastr.js加载后运行jsfiddle.net/noubazzs

标签: javascript jquery jquery-ui toastr


【解决方案1】:

您必须删除 Command: 块。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-19
    • 2015-03-13
    • 1970-01-01
    • 1970-01-01
    • 2016-06-22
    • 1970-01-01
    • 1970-01-01
    • 2018-05-01
    相关资源
    最近更新 更多