简体   繁体   English

外部 css 和 js 未在 android 上加载

[英]External css and js not loading on android

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.当我在 android 上运行 HTML 时,chrome 没有加载外部 CSS 和 js 文件,所有文件都在同一个文件夹中。 Repo回购

Beginner here.初学者在这里。

Html 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 class="main">
    <div class="holder">  
        <div class="bgimg">
        <span>Type in here-</span>
        <input type="text" name="textin" label ="textin" id="Udt1" placeholder="Eg-Racecar">
        <button class="btn" onclick="tex()">Check</button>
      
        </div>
    </div>

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

使用 ./ 到您的 css 链接,而不是 /,例如:./pali.css

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> .如果文件像你说的那样在同一个文件夹中,则不需要斜杠 - 只需<link rel="stylesheet" href="pali.css"><script src="palindrome.js"></script> . If that doesn't work, I would also advise looking for spelling errors in the filenames.如果这不起作用,我还建议在文件名中查找拼写错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM