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 6323429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:30:54+00:00 2026-05-24T16:30:54+00:00

Does it send an HTTP GET request for the specified file? I’m trying to

  • 0

Does it send an HTTP GET request for the specified file? I’m trying to write my own NodeJS webserver, and want to know how to go about dealing with sending the browser the javascript files it needs.

Let’s say I’m using several javascript libraries for a web-app I’m building, and for each of them I have a script tag in the head of my HTML file (e.g. <script type="text/javascript" src="jquery.js"></script>). In my server, would I be able to code something up to call different functions based off of the src requested, and to return a file that isn’t necessarily in the same location that the HTML would make one expect it to be?

I’m still new to NodeJS and webservers in general, so I apologize if this is really obvious to other people out there…

  • 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-24T16:30:54+00:00Added an answer on May 24, 2026 at 4:30 pm

    Does it send an HTTP GET request for the specified file?

    Yes.

    I’m trying to write my own NodeJS webserver, and want to know how to go about dealing with sending the browser the javascript files it needs.

    Then don’t worry about how the browser decides what HTTP requests to make. Just implement the HTTP specification.

    In my server, would I be able to code something up to call different functions based off of the src requested, and to return a file that isn’t necessarily in the same location that the HTML would make one expect it to be?

    This sounds like you are planning to serve up different content for the same URI based on the referer header … I’d expect this to hit a cache and turn into a race condition based nightmare. Don’t do it. Write your HTML so if you need different scripts, you request them from different URIs.

    If, on the other hand, you mean that you want to return data without reading it out of a file on the file system, then that is fine. Clients don’t care how the server determined what data to put in an HTTP response. Just make sure that it is sane and consistent.

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

Sidebar

Related Questions

I want to send a response to a get request made by the javascript
I am trying to send a request to an url like this http://mysite.dk/tværs?test=æ from
Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply
Does the Pony gem support e-mail with SSL/TLS? I'm trying to (easily) send e-mail
Say I make an HTTP request to: foosite.com but the port I actually send
While trying to send a POST request via xmlhttp.open(POST, url, true) (javascript) to the
How HTTP request works:(if i have mistake, please write) user type in browser http://www.website.com
I have already used wininet to send some synchronous HTTP requests. Now, I want
i'm issuing a request using MSXML's XmlHttpRequest object: IXMLHttpRequest http = new XmlHttpRequest(); http.open(GET,
I'm trying to get the contents from another file with file_get_contents (don't ask why).

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.