Information Technology · Ch 2 — Programming
Static vs Dynamic Pages, DHTML and an Introduction to XML
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).
| Point | Static page | Dynamic page |
|---|---|---|
| Content | fixed, same for all | changes per user/request |
| How served | stored file sent as-is | generated at request time |
| Database | not needed | usually reads from a database |
| Example | "About Us" page | your 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"). …
A page whose fixed content is stored as a file and sent unchanged to e …
A page generated at the time it is requested, so its content can change per user, time o …
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 …
eXtensible Markup Language — a markup language for storing and transporting data using user-defined tags; strict about closing and nest …
HTML displays data with fixed tags describing appearance; XML stores/transports data with user-defined tags …