【问题标题】:Show data gathered in a bootstrap toast显示在引导 toast 中收集的数据
【发布时间】:2019-09-12 23:35:58
【问题描述】:

存储一些数据后,我不知道如何让它显示在引导吐司上

(javascript)

function getItemSuccess(data) {
    //4.3 Show the data in a Bootstrap Toast UI component
    $('.toast').toast('show')
    });

(html)

   <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
        <div class="toast-header">
            <img src="..." class="rounded mr-2" alt="...">
            <strong class="mr-auto">DominantColor</strong>
            <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    </div>
    </div>

【问题讨论】:

    标签: javascript html bootstrap-toast


    【解决方案1】:

    试试这个:

       function getItemSuccess(data) {
            $('.toast strong').html(data);
            $('.toast').toast('show')
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-19
      • 2020-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多