1

I'm not sure my load order is correct. Can someone make sure it is?

In "head" :

<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">

In "body" :

<script src="js/bootstrap.js"</script>
<script src="js/jquery-3.2.1.min.js"</script>
<script src="js/jquery-slim.min.js"</script>
<script src="js/popper.min.js"</script>
<script src="js/custom.js"></script>
Neil
  • 14,063
  • 3
  • 30
  • 51
Tomahawk
  • 21
  • 1
  • 3
  • 1
    For your js scripts, jquery should be first since bootstrap depends on jquery – JJJ Nov 19 '17 at 02:40
  • CSS is okay. JS: **1)** jQuery 3.2.1.min.js **2)** bootstrap.js **3)** popper.min.js **4)** custom.js --- **Just TRASH** jquery-slim.min.js since it is another version of jQuery, but without Ajax and animations ([reference here](https://stackoverflow.com/questions/35424053/what-are-the-differences-between-normal-and-slim-package-of-jquery)), so it's already loaded... Don't load it twice. – Louys Patrice Bessette Nov 19 '17 at 02:48
  • See the [Docs](https://getbootstrap.com/docs/4.0/getting-started/introduction/#js) **BootstrapJS** is reliant on **jQuery** and **PopperJS** (they need to be placed prior to **BootstrapJS**). See the [Starter Template](https://getbootstrap.com/docs/4.0/getting-started/introduction/#starter-template) for an example. – vanburen Nov 19 '17 at 04:43
  • 1
    Possible duplicate of [script order for jquery with bootstrap](https://stackoverflow.com/questions/16926086/script-order-for-jquery-with-bootstrap) – adiga Nov 19 '17 at 08:54

2 Answers2

4

In "head" :

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">

In "body" :

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

Try using the minified version they are much smaller therfore much faster to load

Melchia
  • 22,578
  • 22
  • 103
  • 117
2

Check this out !

In head :

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" crossorigin="anonymous">
<!-- CUSTOME STYLE CSS-->
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="style.css">

In Body :

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" crossorigin="anonymous"></script>
Hameed Basha
  • 149
  • 1
  • 12