I am trying to load world.js
in my html page, but it is not working.
Here is my html page -
<!DOCTYPE html>
<html lang="en">
<head>
...
<script src = "../world.js"></script>
...
</head>
<body>...</body>
</html>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js" integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ==" crossorigin=""></script>
<script>
...
L.geoJSON(countries).addTo(map); // (index):64:15
</script>
Whenever I hover the over the source of the script file and press the link of the .js, I go to the correct file.
Whenever I run the app, I get these error messages -
Failed to load resource: the server responded with a status of 404 (NOT FOUND)
(index):64 Uncaught ReferenceError: countries is not defined
at (index):64:15
PS - The .js is a GeoJSON file which has the coordinate of all countries. Also, I have been following this tutorial, He was putting the <script>
tags outside of <html>
tag ad it was working fine for him.
Edit -
Here is the directory imgur.com/a/YjtGLXj
Here is
app.py
-from flask import Flask, render_template
app = Flask(name)
@app.route("/") def home(): return render_template('index_2.html')