Home > Software engineering >  How to enter bootstrap javascript?
How to enter bootstrap javascript?

Time:01-10

Hello I have a problem with bootstrap. I created dropmenu and now it's not working. I use CDN to install bootstrap. Css bootstrap works, but javascript not working. I don't know where is problem. I will grateful if some help me resolve this problem. I don't know where is problem.

<!DOCTYPE html>
<html lang="pl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MessBox</title>
    <link href="https://fonts.googleapis.com/css?family=Baloo Bhai&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="assets/style/search.css" type="text/css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
          integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
    <script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>
<body>

<nav  id="menu">
    <form  action="search.php" method="post">
        <div >
            <input  name="search" placeholder="Wyszukaj" aria-label="Search">
        </div>
        <button  type="submit" name="submitSearch">
            <i  aria-hidden="true"></i>
        </button>
    </form>
    <button  type="button" data-toggle="collapse" data-target="#mainmenu"
            aria-controls="mainmenu" aria-expanded="false" aria-label="Przełącznik nawigacji">
        <span ></span>
    </button>
    <div  id="mainmenu">
        <ul >
            <li  id="panelMenu">
                <a 
                   id="navbarDropdownMenuLink-333"
                   data-toggle="dropdown"
                   aria-haspopup="true"
                   aria-expanded="false">
                    <i ></i>
                    Panel
                </a>
                <div 
                     aria-labelledby="navbarDropdownMenuLink-333">
                    <a  href="statistics.php">Statystyki</a>
                    <a  href="account.php">Ustawienia konta</a>
                    <a  href="settings.php">Ustawienia profilu</a>
                    <a  href="logout.php">Wyloguj się</a>
                </div>
            </li>
        </ul>
    </div>
</nav>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X 965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH 8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV 2 9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
<script src="js./bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C OGpamoFVy38MVBnE IbbVYUew OrCXaRkfj"
        crossorigin="anonymous"></script>
</body>
</html>

nbcgbvbvvv b vbvbbvbbvb

CodePudding user response:

I replaced this line <script src="js./bootstrap.min.js"></script>, Test it like this and tell me :

<!DOCTYPE html>
<html lang="pl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MessBox</title>
    <link href="https://fonts.googleapis.com/css?family=Baloo Bhai&display=swap" rel="stylesheet">
    <!-- <link rel="stylesheet" href="assets/style/search.css" type="text/css"> -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
          integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
    <!-- <script src="https://kit.fontawesome.com/a076d05399.js"></script> -->
</head>
<body>

<nav  id="menu">
    <form  action="search.php" method="post">
        <div >
            <input  name="search" placeholder="Wyszukaj" aria-label="Search">
        </div>
        <button  type="submit" name="submitSearch">
            <i  aria-hidden="true"></i>
        </button>
    </form>
    <button  type="button" data-toggle="collapse" data-target="#mainmenu"
            aria-controls="mainmenu" aria-expanded="false" aria-label="Przełącznik nawigacji">
        <span ></span>
    </button>
    <div  id="mainmenu">
        <ul >
            <li >
                <a  href="<?= htmlEntities($this->profile->profileUrl()) ?>">
                    <i ></i>
                    Profile
                </a>
            </li>
            <li >
                <a  href="<?= htmlEntities($this->profile->photoUrl()) ?>">
                    <i ></i>
                    PhotoView
                </a>
            </li>
            <li >
                <a  href="<?= htmlEntities($this->profile->notificationUrl()) ?>">
                    <i ></i>
                    Notification
                </a>
            </li>
        </ul>
        <ul >
            <li  id="panelMenu">
                <a 
                   id="navbarDropdownMenuLink-333"
                   data-toggle="dropdown"
                   aria-haspopup="true"
                   aria-expanded="false">
                    <i ></i>
                    Panel
                </a>
                <div 
                     aria-labelledby="navbarDropdownMenuLink-333">
                    <a  href="statistics.php">Statystyki</a>
                    <a  href="account.php">Ustawienia konta</a>
                    <a  href="settings.php">Ustawienia profilu</a>
                    <a  href="logout.php">Wyloguj się</a>
                </div>
            </li>
        </ul>
    </div>
</nav>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X 965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH 8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV 2 9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho j7jyWK8fNQe A12Hb8AhRq26LrZ/JpcUGGOn Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
        integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C OGpamoFVy38MVBnE IbbVYUew OrCXaRkfj"
        crossorigin="anonymous"></script>
</body>
</html>

  • Related