我有以下 php 代码回显警报。
echo '<div class="alert alert-warning alert-dismissible" id = "noOperator" role="alert" >
<strong>Not certified! </strong>'.$checkBoxValue.' is not certified to use '.$needleType.'
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span></button>
</div>';
但是我想在它显示后关闭这个警报。因此,我再次给出了以下作为回声。
echo ' <script>
$("#noOperator").fadeTo(2000, 500).slideUp(500, function(){
$("#noOperator").slideUp(500);
});
</script>';
但它不起作用
有谁知道为什么?
繁星点点滴滴