file dhtml ?>
Ali's Homepage - DHTML and its applications
As you've read the HTML and JavaScript subsections of my web site's Programming section, I can talk to you about DHTML: DHTML is actually used for web pages that use HTML and JavaScript simultaneously to add animations and interactivity, and is the acronym for Dynamic HTML.
HOW ELSE COULD WE HAVE USED IT ?
Thought it's a bit out of context, I think it's important to know that HTML and JavaScript may have different uses: HTML can be used for any kind of page design. JavaScript can be used as a scripting language: for details you can check out the Microsoft Windows Scripting web page. For example, I use JScript to do some monthly cleanup and rearrangement jobs on my computer.
FROM HTML TO JAVASCRIPT
To call JavaScript from an HTML page is a fairly easy business: the first method for that is to give a link starting with javascript:, for example <a href=javascript:window.alert("hello")> (to give a try click on the link).
On the other hand, it's important to know that HTML offers much more than that: event-based calls. An HTML event is any kind of thing that happens on the web site: the page having finished loading (onLoad), just before the page being closed (onBeforeUnload), the mouse going over (onMouseOver), finished going over (onMouseOut), clicked (onClick), ... an item (therefore a layer, an image, a table or any other item). Those events can be on the whole document (like onLoad, onUnLoad, onBeforeUnload, onMouseMove, keyboard events like onKeyDown and onKeyUp or page dimension and scrolling events like onResize and onScroll) or for a particular element. Thanks to this, for example, we can change the color of a text when the mouse goes over it:
<div onmouseover=this.style.color="#ff00ff" onmouseout=this.style.color="#000000">test</div>
On my web site, all mouse movements or the MouseDown and MouseUp events (used when you're resizing or moving windows) as well as the MouseOver events (for the dock -icons at the bottom) are catched and handled using JavaScript to make my "window manager" work...
FROM JAVASCRIPT TO HTML
You can give a name to all images, tables and layers: to do so, the id property can be used. For example:
<div id="ali">test</div>
Later, that element can be accessed using the getElementById JavaScript function and therefore we can now change the upper layer's color from the following layer:
<div onmouseover=getElementById("ali").style.color="#ff00ff" onmouseout=getElementById("ali").style.color="#000000">test</div>
As you can see, the color of the "ali" layer changes when the mouse goes over the layer!
MORE THAN JUST WEB PAGES...
My web page is fully coded using DHTML, which somehow shows the power of this method. Yet, there's an even more important thing to see: my web site has a window manager, and that manager is no more than 500 lines long. Yet, Windows' or other operating systems' window managers are at least tens or even hundreds of thousands of lines of code thought they're not more complicated than my web site's. That observation is valid for other applications as well (for example an image browser), therefore using DHTML for an application can save the programmer from lots of lines of coding! Microsoft having remarked this provides the CHtmlView interface for integrating DHTML into any given dialog-box based application. This way, you can have very beautiful and extremely reactive interfaces for your C++ / Basic application with very little coding.
COMFORTABLY WRITING DHTML CODE
There are two kinds of programs for writing DHTML comfortably: enhanced text editors and DHTML editors. Enhanced text editors can recognize and colour the various tags and keywords in your HTML and JavaScript code, making the reading job easier. One example of such an editor is Notepad++, that you can find on my web site's Downloads section. DHTML editors, such as Microsoft FrontPage and Visual Web Developper -both have Express, therefore free editions- or Mozilla's editor, can help you a lot while writing JavaScript: not only they recognize the keywords but also they complete words as you press the CTRL and space keys simultaneously, list all properties that apply to a certain element and even sometimes automatically generate code! Both kinds of programs are generally extremely useful while developping DHTML applications, and you'll find download links for two of those software (my favorites: Notepad++ and Microsoft Visual Studio Express) in my web site's Downloads section.
Page read in 0.0169 seconds and sent using ZIP compression ?>