![](/img/trans.png)
[英]Program will not load Failed to load resource: the server responded with a status of 404 (Not Found)
[英]Failed to load resource: the server responded with a status of 404 (Not Found) for an image with the correct file path
這是在我的網站上顯示側面菜單的圖標的代碼。 使用 Jquery 將其導入我的所有 html 頁面。 出於某種原因,當簡單地使用 img 標簽時,圖像會在這篇文章的標題中返回錯誤。 我以前從未遇到過這個問題,也不知道如何解決它。 它位於同一個
<script src="https://kit.fontawesome.com/11ab057999.js" crossorigin="anonymous"></script>
<div class="logo-wrapper">
<!-- UPS LOGO -->
<img id="fix-token-logo" src="fixTokenLogo.png" alt="">
<div id="menu-icon" onclick="">
<i class="fa-solid fa-bars" onclick="activateMenu()"></i>
</div>
</div>
<script>
function activateMenu () {
const sidebar = document.getElementsByClassName('sidenav-wrapper')
sidebar[0].classList.toggle('hidden')
}
</script>
這包含在我所有的 html 文件中:
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
瀏覽器似乎找不到圖像,請嘗試以下步驟之一:
我在您的 HTML 和腳本中看到的一個錯誤是試圖找到“sidenav-wrapper”類,但在您的 HTML 中沒有“sidenav-wrapper”類,請嘗試將其更改為你想添加類“隱藏”記住:如果你想找到類“sidenav”和“wrapper”,你寫“sidenav wrapper” insted “sidenav-wrapper”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.