• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

131
Views
Why is my script src pointing me to localhost:5000?

My Console

Hello lovely developers! I am experiencing a problem with trying to house my javascript file separate from my .ejs files. In this example, I am point my script tag to "../client/index.js" and I know for a fact this is the location of my javascript file. BUT in this case it thinks I am pointing to localhost:5000/client/index.js when it should be pointing to the files in my internal file structure.

I have never experienced an issue like this. The weird thing is when I follow the link is VS code, it takes me to the correct file location. The problem only occurs when the link is present in the browser. I've tried doing some research on correctly orienting script tags, and I cannot for the life of me find out how to get this working.

Thank you so much your time, I appreciate it!

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

../ means "Go up one level".

You are using it when you are already at / so there isn't a level to go up.

The ../ is therefore discarded.

It would be a security problem if you could craft a URL that would go above the server root and access any files on the computer running the website.

If you want to access the JS file then you will need to put it somewhere where it has a URL, and then use that URL.

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

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error