Javascript 引导/模式警报-日志显示,无警报
基本上,我正在使用的扩展应该在单击时显示一个警报框。但是,该按钮通过转到下一步“跳过验证”来完成它的工作,而不显示它应该显示的框 单击按钮时,我会从控制台收到此消息Javascript 引导/模式警报-日志显示,无警报,javascript,jquery,twitter-bootstrap,Javascript,Jquery,Twitter Bootstrap,基本上,我正在使用的扩展应该在单击时显示一个警报框。但是,该按钮通过转到下一步“跳过验证”来完成它的工作,而不显示它应该显示的框 单击按钮时,我会从控制台收到此消息 $("#usps_skip").click(function() { console.log("skipCLicked"); var msg = "No address information will be stored with the Contact record if you skip
$("#usps_skip").click(function() {
console.log("skipCLicked");
var msg = "No address information will be stored with the Contact record if you skip USPS verification. Do you still wish to skip the USPS verification step?";
$('#errorModal .modal-body').html(msg.split('\n').join('<br />'));
$('#errorModal').modal('show');
});
$(“#usps_跳过”)。单击(函数(){
console.log(“skipCLicked”);
var msg=“如果跳过USPS验证,则联系人记录中不会存储地址信息。是否仍要跳过USPS验证步骤?”;
$('#errorModal.modal body').html(msg.split('\n').join('
'));
$('errorModal').modal('show');
});
控制台中会显示“skipCLicked”日志,但不会显示实际的模式消息警报。有什么建议吗
下面是我在chrome扩展中的代码
- js代码
switch(ObjField.id) { //other case code removed since it is not necessary case "usps_skip": str_field = str_field + '<button class="btn btn-danger" data-target="#errorModal" name="'+ObjField.name+'" id="'+ObjField.id+'" value="">'+ObjField.label+'</button>'; //str_field = str_field + '<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#errorModal" name="'+ObjField.name+'" id="'+ObjField.id+'" value="">'+ObjField.label+'</button>'; break;
开关(ObjField.id) { //已删除其他案例代码,因为它不是必需的 案例“usps_跳过”: str_field=str_field+''+ObjField.label+''; //str_field=str_field+''+ObjField.label+''; 打破
- modal/tabs.htm
&时代; 错误 跳过校验 接近
$('#myModal').on('shown.bs.modal', function (e) {
console.log('is modal open?'); // does it shown in console? if not then modal is not open.
// do something... like $('#errorModal .modal-body').html(msg.split('\n').join('<br />'));
});
$('myModal').on('show.bs.modal',函数(e){
console.log('is modal open?');//它是否显示在控制台中?如果不是,则modal不打开。
//执行一些操作…例如$('#errorModal.modal body').html(msg.split('\n').join('
'));
});
另外,如果console.log(‘模态打开了吗?’)显示在console中,那么您必须检查模态不可见的原因。可能有很多原因,没有高度/宽度,z指数低等等