実現したいこと
jqueryを読み込めるようにしたい
発生している問題・分からないこと
検証を開くと
このようなエラーが出る
エラーメッセージ
error
1Failed to load resource: the server responded with a status of 404 (Not Found) 2main.js:1 3 4 5 Failed to load resource: the server responded with a status of 404 (Not Found) 6index.html:1 Refused to execute script from 'http://127.0.0.1:5500/js/jquery.inview.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 7index.html:1 Refused to execute script from 'http://127.0.0.1:5500/js/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 8index.html:160 Live reload enabled. 9favicon.ico:1 10 11 12 Failed to load resource: the server responded with a status of 404 (Not Found) 13index.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
該当のソースコード
<<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>FA EXHIBITION</title> <meta name="description" content="テキストテキストテキストテキストテキストテキストテキストテキスト"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="img/favicon.ico"> <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400&display=swap" rel="stylesheet"> <link rel="stylesheet" href="style.css"> <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> <script src="js/jquery.inview.min.js"></script> <script src="js/main.js"></script> </head>
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
そのHTMLをどうやってブラウザに表示させていますか。
エラーメッセージを見るとファイルが見つからないようです。パスを間違えているのかもしれません。
フォルダ構成をご提示ください。
vs code のHTMLから表示させています
フォルダの構成?どうやって提示させますか?
https://www.1-humidasu.com/entry/powershell-tree
別に手書きでも構わないですよ。
スクリーンショット拝読。
回答しました。
> vs code のHTMLから
たぶん Live Server か何かを使っているのだと思いますが、VSCode からではなく ブラウザから HTML ファイルを直接開いたら問題は解消しますか?

回答2件
あなたの回答
tips
プレビュー