mercredi 18 novembre 2020

jQuery doesn't load .html file

On my website, I'm trying to pull the content from a .html file, using jQuery. If I manually paste the code it is working, but if I use jQuerry load it doesn't working.

<html>
<head>
    <link rel="stylesheet" type="text/css" href="style.css"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script>$(document).ready(function(){$("#table").load("table.html");});</script>
    <script src="js.js"></script>
</head>
<body>
    <table>
        <tr>
            <td align="center"valign="bottom" nowrap><b>1</b></td>
            <td align="right"valign="bottom" nowrap><b>2</b></td>
            <td align="right"valign="bottom" nowrap><b>3</b></td>
            <td align="center"valign="bottom" nowrap><b>4</b></td>
        </tr>
        <div id="table"></div>
    </table>
</body>
</html>

js.js

<script src="js.js"></script>
<div>
    <tr>
        <script>
            write(8);
        </script>
    </tr>
    <tr>
        <script>
            write(10);
        </script>
    </tr>
</div>
<div>
    <tr>
        <script>
            write(4);
        </script>
    </tr>
</div>



Aucun commentaire:

Enregistrer un commentaire