Download Dhtml

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Cascading Style Sheets wikipedia , lookup

Transcript
About Dhtml
Introduction
Dynamic HyerText Markup Language (DHTML) is a combination of Web development
technologies used to create dynamically changing websites. Web pages may include animation,
dynamic menus and text effects. The technologies used include a combination of HTML,
JavaScript or VB Script,
CSS and the document object model (DOM).
There are four parts to DHTML:

Document Object Model (DOM) (definition)
 Scripts
 Cascading Style Sheets (CSS)
 XHTML
DOM
The DOM is what allows you to access any part of your Web page to change it with DHTML.
Every part of a Web page is specified by the DOM and using its consistent naming conventions
you can access them and change their properties.
With the Document Object Model, programmers can build documents, navigate their structure,
and add, modify, or delete elements and content. Anything found in an HTML or XML
document can be accessed, changed, deleted, or added using the Document Object Model, with a
few exceptions - in particular, the DOM interfaces for the XML internal and external subsets
have not yet been specified.
For example:
<TABLE>
<TBODY>
<TR>
<TD>Shady Grove</TD>
<TD>Aeolian</TD>
</TR>
<TR>
<TD>Over the River, Charlie</TD>
<TD>Dorian</TD>
</TR>
</TBODY>
</TABLE>
A graphical representation of the DOM of the example table is:
Scripts
Scripts written in either JavaScript or ActiveX are the two most common scripting languages
used to activate DHTML. You use a scripting language to control the objects specified in the
DOM.
JavaScript is an object-oriented language with prototypal inheritance. The language supports
several built-in objects, and programmers can create or delete their own objects. Prototypal
inheritance makes JavaScript very different from other popular programming languages such as
C++, C#, or Java featuring classes and classical inheritance. JavaScript does not have classes in
the C++ or Java sense. In JavaScript, objects can inherit properties directly from each other,
forming the object prototype chain.
ActiveX is a set of object-oriented programming (OOP) technologies and tools that Microsoft
developed for Internet Explorer to facilitate rich media playback. Essentially, Internet Explorer
uses ActiveX to load other software applications in the browser.
One of the main advantages of ActiveX components is that they can be re-used by many
applications (referred to as component containers). Unfortunately, that also means that the
component can be re-used by an attacker to run malicious code and gain access to critical files.
Cascading Style Sheets
CSS is used in DHTML to control the look and feel of the Web page. Style sheets define the
colors and fonts of text, the background colors and images, and the placement of objects on the
page. Using scripting and the DOM, you can change the style of various elements.
a cascading style sheet consists of ASCII text instructions telling the browser how it can format
the document that is being loaded. The CSS instructions can be placed in the web page itself, or
it can be placed in a separate document which is linked to the web page.
The simplest way to explain a cascading style sheet is to give an example of one.
Take the following code, for example, inserted in the HEAD section of a web page.
<style type="text/css">
body {
background-color: white ;
color: black ;
font-family: Arial, Helvetica, sans-serif ;
}
</style>
XHTML
XHTML or HTML 4.x is used to create the page itself and build the elements for the CSS and
the DOM to work on. There is nothing special about XHTML for DHTML - but having valid
XHTML is even more important, as there are more things working from it than just the browser.
Html vs xhtml vs xml
HTML is the HyperText Markup Language, which is designed to create structured documents
and provide for semantic meaning behind the documents. HTML5 is the next version of the
HTML specification.
XML is the Extensible Markup Language, which provides rules for creating, structuring, and
encoding documents. You often see XML being used to store data and to allow for
communication between applications. It's programming language-agnostic - all of the major
programming languages provide mechanisms for reading and writing XML documents, either as
part of the core or in external libraries.
XHTML is an XML-based HTML. It serves the same function as HTML, but with the same rules
as XML documents. These rules deal with the structure of the markup.
Features of DHTML


Dynamic content, which allows the user to dynamically change Web page content
Dynamic positioning of Web page elements





Dynamic style, which allows the user to change the Web page’s color, font, size or
content.
Can be used to create animations, games, applications, provide new ways of navigating
through web sites.
DHTML use low-bandwidth effect which enhance web page functionality.
Dynamic building of web pages is simple as no plug-in is required.
Facilitates the usage of events, methods and properties and code reuse.