Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

408
Views
Uncaught SyntaxError: Unexpected token '<' when loading a local JQuery file into a HTML file

I am seeing the "Uncaught SyntaxError: Unexpected token '<' " error at line 1 of my local jquery-3.6.0.min.js file upon clicking the 'Inspect' option after loading my HTML file in Chrome.

The highly unexpected thing is, when I move to "sources" on the inspect window, I can see that the jquery-3.6.0.min.js file is available. However, its contents are the same as my HTML file! I have attached pictures of examining both index.html and my local JQuery file and you can see that they have the same content.

inspecting index.html: enter image description here

inspecting jquery-3.6.0.min.js: enter image description here

Here is how I have loaded the JQuery file into HTML:

<html>
                <head>
                <title>Soren</title>
                    <script type="text/javascript" charset="UTF-8" src="./js/jquery-3.6.0.min.js"></script>
                ...

</html>

I am quite puzzled by this error because upon reading online matter, I at most expected an error 404 page to show up as the JQuery file if there were problems loading it, but the last thing I expected was the JQuery file to contain the parent HTML file's content.

Another point to note is that I am launching the HTML file via a server in python such as:

class MyServer(BaseHTTPRequestHandler):

    def do_GET(self):
        """ do_GET() can be tested using curl command
            'curl http://server-ip-address:port'
        """
        file = codecs.open("/home/pi/Burger/index.html", "r", "utf-8")
        html = file.read()

        temp = os.popen("/opt/vc/bin/vcgencmd measure_temp").read()
        self.do_HEAD()
        status = ''
        self.wfile.write(html.format(temp[5:], status).encode("utf-8"))

if __name__ == '__main__':
    print("Online now")
    http_server = HTTPServer((host_name, host_port), MyServer)
    print("Server Starts - %s:%s" % (host_name, host_port))

Any help will be greatly appreciated! Thanks in advance.

Abhinandan

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!