Dynamic HTML: Difference between revisions

Content deleted Content added
No edit summary
Line 3:
{{Html series}}
 
'''Dynamic HTML''', or '''DHTML''', is a term which was used by some browser vendors to describe the combination of [[HTML]], [[Style sheet (web development)|style sheet]]s and [[Dynamic web page#Client-side scripting|client-side scripts]] (JavaScript, VBScript, or any other supported scripts) that enabled the creation of interactive and animated documents.<ref>{{Cite web|title=Document Object Model FAQ|url=https://www.w3.org/DOM/faq.html#DHTML-DOM|access-date=2022-02-16|website=www.w3.org}}</ref><ref>{{cite web|url=http://www.w3.org/Style/#dynamic|title=Web Style Sheets|website=www.w3.org|access-date=7 April 2018}}</ref> The application of DHTML was introduced by [[Microsoft]] with the release of [[Internet Explorer 4]] in 1997.<ref>{{Cite web |date=2020-07-19 |title=DHTML {{!}} A Quick Glance of DHTML with Components, Features, Need |url=https://www.educba.com/dhtml/ |access-date=2022-10-13 |website=EDUCBA |language=en-US}}</ref>
 
DHTML allows scripting languages to change [[variable (programming)|variable]]s in a web page's definition language, which in turn affects the look and function of otherwise "static" HTML page content, after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load.
 
By contrast, a [[dynamic web page]] is a broader concept, covering any web page generated differently for each user, load occurrence, or specific variable values. This includes pages created by client-side scripting, and ones created by [[server-side scripting]] (such as [[PHP]], [[Python (programming language)|Python]], [[JavaServer Pages|JSP]] or [[ASP.NET]]) where the web server generates content before sending it to the client.
 
DHTML is the predecessor of [[Ajax (programming)|Ajax]] and DHTML pages are still request/reload-based. Under the DHTML model, there may not be any interaction between the client and server after the page is loaded; all processing happens on the client side. By contrast, Ajax extends features of DHTML to allow the page to initiate network requests (or 'subrequest') to the server even after page load to perform additional actions. For example, if there are multiple tabs on a page, the pure DHTML approach would load the contents of all tabs and then dynamically display only the one that is active, while AJAX could load each tab only when it is really needed.
 
== Uses ==
 
DHTML allows authors to add effects to their pages that are otherwise difficult to achieve, by changing the [[Document Object Model]] (DOM) and page style. The combination of HTML, CSS, and JavaScript offers ways to:
 
* Animate text and images in their document.
Line 20:
* Include rollover buttons or drop-down menus.
 
A less common use is to create browser-based action games. Although a number of games were created using DHTML during the late 1990s and early 2000s,<ref>{{Cite web |title=Stephen's Web ~ Fun and Games With DHTML ~ Stephen Downes |url=https://www.downes.ca/post/276 |access-date=2022-08-27 |website=www.downes.ca |language=en}}</ref> differences between browsers made this difficult: many techniques had to be implemented in code to enable the games to work on multiple platforms. Recently browsers have been converging towards [[web standards]], which has made the design of DHTML games more viable. Those games can be played on all major browsers and they can also be ported to [[KDE Plasma Workspaces|Plasma]] for [[KDE]], Widgets for [[macOS]], and Gadgets for [[Windows Vista]], which are based on DHTML code.
 
The term "DHTML" has fallen out of use in recent years as it was associated with practices and conventions that tended to not work well between various web browsers.<ref>{{cite book |last1=Ferguson |first1=Russ |last2=Heilmann |first2=Christian |title=Beginning JavaScript with DOM Scripting and Ajax |date=2013 |publisher=Berkeley, CA: Apress |pages=49-68 |url=https://link-springer-com.huaryu.kl.oakland.edu/content/pdf/10.1007/978-1-4302-5093-7.pdf |access-date=May 30, 2022}}</ref>
Line 106:
==Document Object Model==
{{main|Document Object Model}}
DHTML is not a technology in and of itself; rather, it is the product of three related and complementary technologies: HTML, Cascading Style Sheets (CSS), and [[JavaScript]]. To allow scripts and components to access features of HTML and CSS, the contents of the document are represented as objects in a programming model known as the [[Document Object Model]] (DOM).
 
The DOM API is the foundation of DHTML, providing a structured interface that allows access and manipulation of virtually anything in the document. The HTML elements in the document are available as a hierarchical [[tree (data structure)|tree]] of individual objects, making it possible to examine and modify an element and its attributes by reading and setting properties and by calling methods. The text between elements is also available through DOM properties and methods.
Line 167:
== External links ==
{{Sister project|project=wikibooks|text=JavaScript/DHTML}}
* [http://www.quirksmode.org/ QuirksMode], a comprehensive site with test examples and instructions on how to write DHTML code whichthat runs on several browsers.
* [http://www.yourhtmlsource.com/javascript/dhtmlexplained.html Introductory DHTML Tutorial]