0
我在bootstrap-datetimepicker.js
的752行有JS錯誤。 當我點擊時間按鈕時也會發生這種情況。自舉時間選擇器無法正常工作
的錯誤是:
TypeError: 'undefined' is not a function(evaluating'expanded.collapse('hide')')
爲什麼會出現這種情況?我該如何解決它?
我在bootstrap-datetimepicker.js
的752行有JS錯誤。 當我點擊時間按鈕時也會發生這種情況。自舉時間選擇器無法正常工作
的錯誤是:
TypeError: 'undefined' is not a function(evaluating'expanded.collapse('hide')')
爲什麼會出現這種情況?我該如何解決它?
根據issue on github,如果不包含bootstrap.js
文件,則會發生此錯誤,因爲其中定義了collapse
。
確保您有相應的版本:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
你能爲我們提供一些代碼? – brothers28
並且還提供了timepicker&bootstrap.js版本 –