How multiple requests happens from a web browser for a simple URL?

While trying to serve a page from node.js app I hit with this question. how multiple files are serving from a server with a simple request from user?

For eg:

  1. A user enters www.google.co.in in address bar
  2. browser make a request to that url and it should end there with a response. But whats happening is, few more requests are sending from that page to server like a chain.

What I am thinking now is, how my web browser(chrome) is sending those extra requests... Or who is prompting chrome to do it? and ofcourse, how can I do the same for my node.js app.

Once chrome gets the html back from the website, it will try to get all resources (images, javascript files, stylesheets) mentioned on the page, as well as favicon.ico That's what I think you are seeing

You can have as many requests as you want, from the client side (browser), using ajax. Here's a basic example using jQuery.get, an abstraction of an ajax call:

$.get(
    "http://site.com",
    function(data) { alert(data); }
);