Home > database >  External css and js not loading on android
External css and js not loading on android

Time:06-07

When I'm running the HTML on android, chrome is not loading the external CSS and js files, all the files are in the same folder. Repo

Beginner here.

Html

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Palindrome Checker</title>
             <link rel="stylesheet" href="/pali.css"> 
<!-- Before <link rel="stylesheet" href="pali.css">
also tried <link rel="stylesheet" href="./pali.css">  -->
      </head>
<body>
    <h1>Palindrome Checker</h1>
    <div >
    <div >  
        <div >
        <span>Type in here-</span>
        <input type="text" name="textin" label ="textin" id="Udt1" placeholder="Eg-Racecar">
        <button  onclick="tex()">Check</button>
      
        </div>
    </div>

     <span ><p id="udans">  </p>
         </span>
        </div>
</body>
<script src="/palindrome.js"></script>
</html>

CodePudding user response:

use ./ to your css link, not /, ex: ./pali.css

CodePudding user response:

If the files are in the same folder like you said, the slash isn't necessary - simply <link rel="stylesheet" href="pali.css"> and <script src="palindrome.js"></script>. If that doesn't work, I would also advise looking for spelling errors in the filenames.

  • Related