Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 821299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:37:05+00:00 2026-05-15T02:37:05+00:00

If you do script src=/path/to/nonexistent/file.js in an HTML file and call that in a

  • 0

If you do script src=”/path/to/nonexistent/file.js” in an HTML file and call that in a browser, and there are no dependencies or resources anywhere else in the HTML file that expect the file or code therein to actually exist, is there anything inherently bad-practice about doing this?

Yes, it is an odd question. The rationale is the developer is dealing with a CMS that allows custom (self-contained) javascript files to be provided in certain circumstances. The problem is the CMS is not very flexible when it comes to creating conditional includes for javascript. Therefore it is easier to just make references to the self-contained js files regardless of whether they are actually at the specified path.

Since no errors are displayed to the user, should this practice be considered a viable option?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:37:06+00:00Added an answer on May 15, 2026 at 2:37 am

    If you have the script referred to in the <head> tag, ( not recommended for starters ), it will slow down the initial page-render time somewhat too.

    If instead of quickly returning a 404, your site just accepts the connection and then never responds, this can cause the page to take an indefinite amount of time to load, and in some cases, lock up the entire user interface.

    ( At least that was the case with one revision of FireFox, I hope they’ve fixed it since I saw that happen ~2 years ago.* )

    You should at least put the tags as low in the page order as you can afford to to remedy this problem.

    Your best bet by far is to have one consistent no-op url that is used as a fill-in for all “doesn’t exist” JavaScript files, that returns a 0-byte response with HTTP headers telling the UA to cache it till the cows come home, that should negate most your server<->client load penalties beyond the first hit ( and that should hardly hurt people even on ye-olde dialup )

    *Lesson learned: don’t put script-src references in head, especially for 3rd-party scripts hosted outside your machine, because then you can have the joy of having clients be able to access your website, but run the risk of the page being inoperable because of a bit of advertising JS that was inaccessible due to some internet weirdness. Even if they’re a reputable-ish 3rd-party.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think one of your initial problems is that your… May 16, 2026 at 11:25 am
  • Editorial Team
    Editorial Team added an answer The Target property takes the element itself, not a string,… May 16, 2026 at 11:25 am
  • Editorial Team
    Editorial Team added an answer Yes you need to do that, discard the fact if… May 16, 2026 at 11:25 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm used to including and using JS like so: <script type='text/javascript' src='/path/to/script.js'></script> .... <script
Possible Duplicate: What is my script src URL? I have situation: <script type=text/javascript src=http://server/some.js>
I'm using jQuery UI: <script type=text/javascript src=/jscripts/jquery-1.4.min.js></script> <script type=text/javascript src=/jscripts/jquery-ui-1.8.2.custom.min.js></script> and IE7 (corporate rule!)
I would like to replace the source url of the script on the fly
I need to increment a number in a source file from an Ant build
I'm trying to load a flash file using 'AC_FL_RunContent' like below. But the file
I can't get my Junit tests to run from my build.xml script. I feel
I am trying to inject JQuery into a UIWebView of a page that I
From the Flattr Javascript API description : <script type=text/javascript> <!--//--><![CDATA[//><!-- (function() { var s
I need a way to take a block of HTML code and make all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.