How to correctly use the jQuery plugins?

0

It turns out that I'm doing a search menu, but the connection to the jQuery does not work to hide the content of it. When I look at the Google Chrome console, the following errors appear:

jquery-3.3.1.min:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
dataTable.min:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
buscador.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

What could I have wrong?

This is my HTML code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Practica</title>
<script src="js/jquery-3.3.1.min"></script>
<script src="js/dataTable.min"></script>
<link rel="stylesheet" type="text/css" href="estilos.css">
</head>
<body>
<header>
<div class="header-top">
        <div class="navegacion">
            <input type="search" placeholder="Buscar..." id="inputBusqueda">
        </div>
    </div>
    <div class="search" id="search">
    <table class="search-table" id="searchTable">
        <thead>
            <tr>
                <td></td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><a href=""><em>Practica</em></td></a>
            </tr>
            <tr>
                <td><a href=""><em>Msyql</em></td></a>
            </tr>
            <tr>
                <td><a href=""><em>C++</em></td></a>
            </tr>
            <tr>
                <td><a href=""><em>HTML</em></td></a>
            </tr>
            <tr>
            </tr>
            </tr>
        </tbody>
    </table>
    </div>
</header>
<div class="wrap">
</div>
<script src="buscador.js/js"></script>
</body>
</html>

This is my JQuery code:

var consulta= $ ("#searchTable").DateTable();
$("#inputBusqueda").keyup(function){
consulta.search($(this).val()).draw();
})

    
asked by Mateo Gomez 30.10.2018 в 19:56
source

1 answer

1

The problem you have is that you have added the files inside the tag without its extension .js.

As you have it:

<script src="js/jquery-3.3.1.min"></script>

As it should be:

<script src="js/jquery-3.3.1.min.js"></script>
  

.min means that the file is compressed but is still a   javascript file therefore carries its extension .js

Based on the problem of your DataTable Table:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Practica</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
    <link rel="stylesheet" type="text/css" href="estilos.css">
    </head>
    <body>
    <header>
    <div class="header-top">
            <div class="navegacion">
                <input type="search" placeholder="Buscar..." id="inputBusqueda">
            </div>
        </div>
        <div class="search" id="search">
        <table class="search-table" id="searchTable">
            <thead>
                <tr>
                    <td></td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td><a href=""><em>Practica</em></td></a>
                </tr>
                <tr>
                    <td><a href=""><em>Msyql</em></td></a>
                </tr>
                <tr>
                    <td><a href=""><em>C++</em></td></a>
                </tr>
                <tr>
                    <td><a href=""><em>HTML</em></td></a>
                </tr>
                <tr><td></td></tr>
            </tbody>
        </table>
        </div>
    </header>
    <div class="wrap">
    </div>
    <script src="js/buscador.js"></script>
    </body>
    </html>

Try and tell me. Greetings.

    
answered by 30.10.2018 в 20:37