Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What computer languages does my browser understand?

I am trying to understand computer languages on a client-side and server-side level a little bit better. From what I understand, client-side code (HTML, CSS and Javascript) are all built into the browwer and can be understood without an internet connection.

However, let's say I build a simple blog application in Python or Ruby. Would my server have the ONLY knowledge of how to break down the Python and Ruby code before sending it back to the client? If so, how does the server compile/interpret the code before sending it back to the client/browser for it to understand?

Please help me understand this.

like image 369
Stack Overflow Avatar asked Mar 17 '23 13:03

Stack Overflow


1 Answers

This is a very general and broad response:

A web server (server) and and a browser (client) like Firefox will communicate by sending text to each other. The method this 'text' is sent is described by a set of rules, or a protocol called Hyper Text Transfer Protocol (HTTP).

HTTP responses contain a 'body' field. This body contains text. The server may send any text to the client it wants. How the client renders said text is up to the client. The text could take the form of HTML, CSS, JAVASCRIPT, Chinese, numbers..... So if the text the server sends to the client is in HTML format, the client will render it so. The same is true for CSS and Javascript.

But how does the server know what to send to the client? Simply put, the person who built the website and owns the server put the code onto the server and said 'respond to clients with this stuff when you receive a request.'

Wait, so what's the deal with Python/Ruby/Java etc and those languages being used to write servers? Servers are programs that take 'requests' and handle the logic that decides how to respond, and what to respond with. The actual content of what the response contains however, has nothing to do with the language that is used to handle the response.

like image 141
steve Avatar answered Apr 27 '23 19:04

steve