2017-08-13 102 views
7

突然間,我開始時,我嘗試打開我的下拉菜單中得到錯誤:bootstrap.min.js:6未捕獲的錯誤:引導下拉需要Popper.js

bootstrap.min.js:6 Uncaught Error: Bootstrap dropdown require Popper.js (https://popper.js.org) 
     at bootstrap.min.js:6 
     at bootstrap.min.js:6 
     at bootstrap.min.js:6 

我使用標準的引導文件

<script src="https://getbootstrap.com/dist/js/bootstrap.min.js">

bootstrap中有任何改變我必須小心謹慎?

令我加載的文件是繼

<script src="https://code.jquery.com/jquery-1.9.1.js"></script> 
<script src="{{ STATIC_URL }}/static/jquery/jquery-1.9.1.js"></script> 
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
<script src="{{ STATIC_URL }}/static/jquery/jquery-ui.js"></script> 




<script src="https://getbootstrap.com/dist/js/bootstrap.min.js"></script> 
<!-- Just to make our placeholder images work. Don't actually copy the next line! --> 
<script src="https://getbootstrap.com/assets/js/vendor/holder.min.js"></script> 
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> 
<script src="https://getbootstrap.com/assets/js/ie10-viewport-bug-workaround.js"></script> 
+0

可能重複[Bootstrap 3導航欄不再工作](https://stackoverflow.com/questions/45634415/bootstrap-3-navbar-doesnt-work-anymore) –

回答

18

你看了介紹引導的? https://getbootstrap.com/docs/4.0/getting-started/introduction/#quick-start

您必須添加一些腳本才能使引導程序完全正常工作。 Popper.js就是其中之一:

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script> 
+3

是的,你是正確的,謝謝。不過這是新鮮事。因爲它一直沒有那些額外的內容。 –

+0

它也是由於自舉更新發生,如果我切換到CDN它也可以工作 https://www.bootstrapcdn.com/ –

+0

它使用是需要的tether.js。 – lasec0203

1

爲了引導測試版才能正常工作,必須將腳本按以下順序排列。

<script src="js/jquery-3.2.1.min.js"></script> 
    <script src="js/popper.min.js"></script> 
    <script src="js/bootstrap.min.js"></script> 
1

引導4尚不成熟的工具呢。需要另一個插件工作的部分更加複雜,特別是對於一直使用Bootstrap的開發者來說更​​是如此。我看到了很多方法來消除這個錯誤,但並不是每個人都適用。我認爲使用Bootstrap 4的最好和最乾淨的方式。在Bootstrap安裝文件中,有一個名稱爲「bootstrap.bundle.js」 已包含Popper。