基于this示例:
<div class="input-group">
<input type="text" class="form-control datetimepicker-input" id="datetimepicker5" data-toggle="datetimepicker" data-target="#datetimepicker5"/>
<div class="input-group-append">
<button class="btn btn-outline-danger">Clear</button>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker5').datetimepicker();
});
</script>
此代码无法正常工作,并在浏览器控制台中导致以下消息:https://gist.github.com/Xymanek/7517ba05bf66ce6d8f1fdc1b3a441aff
但是,当我在jsfiddle中尝试时,它工作正常:https://jsfiddle.net/3do7nL25/
寻找可以导致它在我的项目中中断的原因。这些是该页面上存在的JS库(我的js都没有涉及html):
<script src="~/Scripts/jquery-3.3.1.js"></script>
<script src="~/Scripts/umd/popper.js"></script>
<script src="~/Scripts/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="~/Scripts/ckeditor/ckeditor.js"></script>
使用最新的firefox测试