[英]AlertJS modal title doesn't show
I need to show both alert message and alertmodal title.我需要同时显示警报消息和警报模式标题。 Currently, only AlertJS shows.
目前,只有 AlertJS 显示。 When I try and add a title after the second comma the modal shows the message as the title.
当我尝试在第二个逗号后添加标题时,模式将消息显示为标题。 How can I have both a message and title?
我怎样才能同时拥有消息和标题? Is this possible?
这可能吗?
AlertJS modal title not displaying: AlertJS 模式标题不显示:
$('#confirmSingles').click(function() {
alertify.confirm('Are you sure you want to confirm all listed singles?', function() {
$.ajax({
url: 'api/singles/confirm'
}).always(function(data) {
handleConfirmResponse(data);
});
});
});
According to the Alertify documentation , the library uses a global alertify.defaults
object to store settings.根据Alertify 文档,该库使用全局
alertify.defaults
对象来存储设置。 The title value is stored within this object.标题值存储在此对象中。 To change the title, simply provide a new value for the
alertify.defaults.glossary.title
property:要更改标题,只需为
alertify.defaults.glossary.title
属性提供一个新值:
$('#confirmSingles').click(function() { alertify.defaults.glossary.title = "Your title here..."; alertify.confirm('Are you sure you want to confirm all listed singles?', function() { $.ajax({ url: 'api/singles/confirm' }).always(function(data) { // handleConfirmResponse(data); console.log('todo...'); }); }); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="//cdn.jsdelivr.net/npm/alertifyjs@1.13.1/build/alertify.min.js"></script> <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.13.1/build/css/alertify.min.css" /> <button id="confirmSingles">Confirm</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.