Web documents and browsers

Web Documents and Browsers

 


A web document refers to any type of digital content that is accessible on the World Wide Web (WWW). It is essentially a file or resource that can be viewed or accessed through a web browser. Web documents can take various forms, including text files, images, videos, audio files, interactive applications, and more.

 

The most common type of web document is an HTML (Hypertext Markup Language) document. HTML is the standard markup language used to structure and present content on the web. HTML documents consist of text-based elements that define the structure, formatting, and layout of a web page. These elements can include headings, paragraphs, links, images, tables, forms, and other elements that make up the content of a webpage.

 

Other types of web documents include:

 

CSS (Cascading Style Sheets) files: These files contain style information used to control the appearance and layout of HTML documents. CSS is responsible for defining colors, fonts, spacing, and other visual aspects of a webpage.

 

JavaScript files: JavaScript is a programming language that enables interactivity and dynamic behavior on web pages. JavaScript files contain code that can manipulate HTML elements, respond to user actions, fetch data from servers, and perform other tasks.

 

Images: Web documents often include image files such as JPEG, PNG, or GIF formats. Images can be embedded directly in HTML documents or referenced from separate image files.

 

Videos and audio files: Web documents can also include multimedia elements, such as embedded videos or audio files. These elements can be played directly within the web page using appropriate browser plugins or HTML5 tags.

 

Web documents are typically hosted on web servers and accessed by users through web browsers like Google Chrome, Mozilla Firefox, Safari, or Microsoft Edge. When a user enters a web address (URL) in the browser's address bar or clicks on a hyperlink, the browser sends a request to the web server, which responds by sending the corresponding web document to the user's browser for display.

 

There are three types of Web Documents:

  • Static web document
  • Dynamic Web Document
  • Active Web Document

 

Static Web Document

 

They are fixed content documents created and stored on the server. Client gets only a copy of the document. The contents of the files are determined when created and not when it is used.

 

Dynamic Web Document

 

Dynamic web documents are created by the server only when a browser requests a document. When requests arrive, the server runs the application program that creates dynamic documents and returns output as response to the browser. So the contents of a dynamic document can vary from one request to another. Two ways to create dynamic documents are,

 

  • Common Gateway Interface:

The Common Gateway Interface (CGI) is a standard protocol that allows web servers to interact with external programs or scripts. It provides a mechanism for the web server to communicate with other software or applications and generate dynamic content for web pages.

 

In the early days of the web, static HTML documents were the primary form of content. However, with the need for more dynamic and interactive websites, CGI was developed as a way to incorporate server-side programming into the web server's functionality.

 

When a web server receives a request for a CGI script or program, it invokes the program and passes along any necessary parameters or data from the request. The CGI program processes the input, performs actions such as database queries or computations, and generates output dynamically. The output is then returned to the web server, which sends it back to the user's browser as part of the HTTP response.

 

CGI programs can be written in various programming languages, including Perl, Python, PHP, Ruby, and more. The CGI protocol defines how the web server and the CGI program communicate, specifying how data is passed between them through environment variables and standard input/output streams.

 

It's important to note that while CGI was an early and widely used mechanism for dynamic web content, it has been largely superseded by more efficient and secure alternatives such as server-side scripting languages (e.g., PHP, ASP.NET, Node.js) and application frameworks (e.g., Ruby on Rails, Django, Laravel). These alternatives provide more streamlined and integrated ways to generate dynamic web content without relying on the external process invocation model of CGI.

 

  • Scripting Technologies like PHP,JSP,ASP…etc embedded in HTML pages.

 

Active Web Document:

These are the program runs at the client side. When the browser requests active documents ,the server sends a copy of the document or script and the document is then run on the client site. Active documents are created in two ways,

 

  • Java Applets – programs written in java on the server are compiled and ready to run.Browser creates an instance of this applet and runs it.

 

  • Javascript is interpreted and run by the client at the same time.

 

 

Web Browsers:

 


A browser is a software application that allows users to access and navigate the World Wide Web (WWW). It serves as an interface between the user and the internet, enabling the retrieval and display of web documents, such as HTML pages, images, videos, and other resources.

 

Browsers provide several core functionalities to enhance the browsing experience:

 

  • Rendering Engine: Browsers use a rendering engine (also known as a layout engine) to interpret and display web documents. The rendering engine parses HTML, CSS, and other web technologies to render web pages correctly. Examples of rendering engines include Blink (used by Google Chrome and Microsoft Edge), Gecko (used by Mozilla Firefox), and WebKit (used by Safari).

 

  • User Interface: Browsers have a user interface (UI) that allows users to interact with the browser and control their browsing activities. The UI typically includes elements such as the address bar, back/forward buttons, refresh button, bookmarks, and tabs. The UI provides navigation controls and displays the content of web pages.

 

  • Networking: Browsers handle the communication between the user's computer and web servers. They implement networking protocols, such as HTTP (Hypertext Transfer Protocol), to send requests for web documents and receive responses from servers. Browsers can also handle other protocols like HTTPS (HTTP Secure) for secure communication.

 

  • Security: Browsers play a critical role in ensuring the security of users while browsing the web. They implement security features such as built-in phishing and malware protection, warning messages for potentially dangerous websites, and support for secure connections using SSL/TLS protocols.

 

  • Extensions and Add-ons: Browsers often allow users to enhance their browsing experience by installing extensions or add-ons. These are additional software components that provide extra functionality, such as ad blockers, password managers, language translators, and more. Extensions are usually developed using web technologies like HTML, CSS, and JavaScript.

 

  • Cookies and Caching: Browsers store cookies and cache data to improve performance and provide personalized browsing experiences. Cookies are small pieces of data sent by websites and stored on the user's computer, while caching allows browsers to store copies of web documents locally to reduce the need for repeated downloads.

 

  • Cross-Platform Compatibility: Browsers are available for various operating systems, including Windows, macOS, Linux, iOS, and Android. They aim to provide a consistent browsing experience across different devices and platforms.

 

Some popular browsers include Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Edge, and Opera. Each browser may have its unique features, performance characteristics, and developer tools, but they all aim to provide users with a fast, secure, and user-friendly web browsing experience.