Skip to content

Information Technology · Ch 2 — Programming

Static vs Dynamic Pages, DHTML and an Introduction to XML

8

Static vs Dynamic Pages, DHTML and an Introduction to XML

Not all web pages behave the same way. A key distinction is between static and dynamic pages, and alongside plain HTML you will meet two related terms — DHTML and XML.

Static vs dynamic web pages

A static web page shows the same fixed content to every visitor, every time. It is written once in HTML and stored as a file; the server simply sends that file unchanged. A school's "About Us" page is a good example.

A dynamic web page is generated when it is requested, so its content can change — with the user, the time, or data from a database. When you log in and see your own marks, the page was built specially for you from database data. Dynamic pages usually combine HTML with a server-side program (and often a database via JDBC, as in Section 5).

PointStatic pageDynamic page
Contentfixed, same for allchanges per user/request
How servedstored file sent as-isgenerated at request time
Databasenot neededusually reads from a database
Example"About Us" pageyour personalised marks/dashboard

DHTML — Dynamic HTML

DHTML (Dynamic HTML) is not a new language. It is the combination of ordinary HTML, CSS (Cascading Style Sheets, which control colour, fonts and layout) and a client-side script (such as JavaScript) that together let a page change in the browser — for example, a menu that opens when you hover, or text that changes colour when clicked — without reloading the page. DHTML adds interactivity on the visitor's own computer, whereas a dynamic page (above) is built on the server.

An introduction to XML

XML — eXtensible Markup Language — is a markup language for storing and carrying data, not for displaying it. Where HTML has a fixed set of tags that describe appearance (<p>, <h1>, <table>), XML lets you invent your own tags that describe meaning:

<student>
  <roll>21</roll>
  <name>Amit</name>
  <marks>88</marks>
</student>

Here <roll>, <name> and <marks> are tags you created to label the data. Key differences from HTML:

  • Purpose: HTML displays data in a browser; XML stores and transports data between programs.
  • Tags: HTML tags are predefined and fixed; XML tags are user-defined ("extensible"). …
Definition 1Static web page

A page whose fixed content is stored as a file and sent unchanged to e …

Definition 2Dynamic web page

A page generated at the time it is requested, so its content can change per user, time o …

Definition 3DHTML

Dynamic HTML — the combination of HTML, CSS and a client-side script (e.g. JavaScript) that makes a page change in the browser without reloading …

Definition 4XML

eXtensible Markup Language — a markup language for storing and transporting data using user-defined tags; strict about closing and nest …

Definition 5HTML vs XML

HTML displays data with fixed tags describing appearance; XML stores/transports data with user-defined tags …