Academic Tutorials



English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting
Chats

XML Tutorial
XML Introduction
XML How to use
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Validator
XML Browsers
XML Viewing
XML CSS
XML XSL
XML Data Island
XML Parser
XML in Real Life
XML Namespaces
XML CDATA
XML Encoding
XML Server
XML Application
XML HTTP Request
XML Save Data
XML Behaviors
XML Technologies
XML Editors
XML Summary
XML as Data Source

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Network Sites


XML DHTML Behaviors

Previoushome Next



Behaviors


Behavioral extensions provide a standard way for declaration of standalone behaviors that can be attached to any HTML or XML element, without modification of the DTD. Partly based on extensions to Cascading Style Sheets (CSS), these behaviors can be applied to multiple documents using the existing CSS linking mechanisms.

A D V E R T I S E M E N T

Through XML we can link behaviors to any element in a web page and manipulate that element.

DHTML are using a CSS attribute called "behavior" in place of <script> tag.This "behavior" specifies a URL to an HTC file which contains the actual behavior (The HTC file is written in XML)

Syntax

behavior: url(some_filename.htc)

Note: The behavior attribute is only supported by IE 5 and higher. All other browsers will ignore it, means that Mozilla, Firefox, Netscape and other browsers will only see the regular content and IE 5+ can see the DHTML behaviors.



Benefits:

DHTML behaviors makes things easier for everyone involved in the Web development process and add great value to a Web application environment. In the real world, this environment consists of a team of content authors, designers, and developers. Content authors are responsible for writing content. Designers determine what interactive effects can be added to the content, while developers implement those effects.

The following section outlines the advantages and benifits by using behaviors.

  • Behaviors Provide a Means for code reuse and Script Encapsulation
  • Behaviors allow Designers to Add Interactive Effects with a Simple Declarative Syntax
  • Behaviors Isolate Script from Content, Resulting in more manageable and Cleaner Pages
  • Behaviors engross Easy-to-Create Components

Behaviors Provide a Means for code reuse and Script Encapsulation

With behaviors,it is very easy to add interactive effects as encapsulated components that can be reused across multiple pages. For example, consider one of the more popular effects made possible in Internet Explorer 4.0: onmouseover highlights. Through the use of CSS rules, and the ability to change styles on the fly, it is easy to achieve this effect on a page. In Internet Explorer 4.0, the way to implement onmouseover highlights on a list item, or li, would be to handle the onmouseover and onmouseout events in this manner:


<HEAD>
<STYLE>
HILITE
{ color:red;letter-spacing:2; }
</STYLE>
</HEAD>

<BODY>
<UL>
<LI onmouseover="this.className='HILITE'"
onmouseout ="this.className=''">HTML Authoring</LI>
</UL>
</BODY>
 


Beginning with Internet Explorer 5, a DHTML behavior can be implemented to achieve this effect. This behavior, when applied to an li element, extends the list item's default behavior to change its color when the user moves the mouse over it.

The following example implements a behavior in the form of an HTML Component (HTC) file, which is contained in the hilite.htc file, to achieve the onmouseover highlight effect. The behavior is applied to the li with the familiar style block, using the proposed CSSbehavior attribute that specifies the location of the behavior. With the behavior applied, the preceding code can look something like this in Internet Explorer 5 and later:


<HEAD>
<STYLE>
LI {behavior:url(hilite.htc)}
</STYLE>
</HEAD>

<BODY>
<UL>
<LI>HTML Authoring</LI>
</UL>
</BODY>
 


Behaviors allow Designers to Add Interactive Effects with a Simple Declarative Syntax

Currently, the task of adding interactive effects to a page can involve a lengthy iterative process between the designer and the developer trying to give the page that perfect look. The designer, usually with limited programming background, mocks up the desired effect on the content in a desktop publishing environment, and works closely with the developer to achieve the same effect on the page, usually with Dynamic HTML.

With behaviors, a developer can work independently on encapsulating the desired effect in a separate file, while the designer applies that behavior to elements on the page with a few CSS attributes. By providing a simple declarative syntax, requiring no prerequisite knowledge of scripting and DHTML, behaviors empower Web designers to easily add interactive effects to an otherwise static content. As seen in the preceding example, adding an onmouseover highlighting effect on a list item is as easy as adding the familiar style block, in exactly the same way a style is attached to an element through CSS.


Behaviors Isolate Script from Content, Resulting in more manageable and Cleaner Pages

Behaviors provide easy partition of script from contents, as it moves all script contained in a page into a separate file. The previous example demonstrated how the script to handle the onmouseover and onmouseout events was moved to a separate file, hilite.htc. This example can be extended to implement hiding content and display it, making it even easier to see how behaviors can make a difference, and how script isolation results in a cleaner, script-free page.

The following example demonstrates the use of the two effects, onmouseover highlight and displaying/hiding content, in a table of contents scenario. The same example has been implemented two different ways:

  • For Internet Explorer 5.0 & later, using Dynamic HTML

    Using DHTML behaviors, the code to implement the same table of contents looks a lot cleaner, as most of the script is isolated into a separate file.


<HEAD>
<STYLE>
CollapsingAndHiliting {behavior:url(ul.htc) url(hilite.htc))}
A {behavior:url(hilite.htc)}
</STYLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">


<FONT SIZE=1 FACE="Verdana,Arial,Helvetica">

<UL>
<LI CLASS="CollapsingAndHiliting" CHILD="Topics1">HTML Authoring</LI>
<UL ID="Topics1">
<LI><A HREF="/workshop/author/default.asp">Beginner's Guide</A></LI>
<LI><A HREF="/workshop/author/default.asp">IE4.0 Authoring Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding Tips</A></LI>
<LI><A HREF="/workshop/author/default.asp">Table Cell Backgrounds</A></LI>
<LI><A HREF="/workshop/author/default.asp">Drop Caps</A></LI>
<LI><A HREF="/workshop/author/default.asp">Quote Server</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Wizard</A></LI>
<LI><A HREF="/workshop/author/default.asp">Dr. HTML</A></LI>
<LI><A HREF="/workshop/author/default.asp">HTML Coding FAQ for Internet Explorer</A></LI>
<LI><A HREF="/workshop/author/default.asp">SGML DTD for Internet Explorer 3.0 Markup</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Basics</A></LI>
<LI><A HREF="/workshop/author/default.asp">Authoring Effective Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Designing Efficient Pages</A></LI>
<LI><A HREF="/workshop/author/default.asp">Using Frames</A></LI>
</UL>
<LI><A HREF="/workshop/author/default.asp">HTML Help Authoring</A></LI>
<LI CLASS="CollapsingAndHiliting" CHILD="Topics2">HTML References</LI>
<UL ID="Topics2">
<LI><A HREF="/workshop/author/default.htm">Elements</A></LI>
<LI><A HREF="/workshop/author/default.htm">Character Sets</A></LI>
</UL>
<LI CLASS="CollapsingAndHiliting" CHILD="Topics3">HTML Applications (HTA)</LI>
<UL ID="Topics3">
<LI><A HREF="/workshop/author/default.htm">Overview</A></LI>
<LI><A HREF="/workshop/author/default.htm">Reference</A></LI>
</UL>
</UL>
</FONT>
</BODY>


Behaviors engross Easy-to-Create Components

HTC files provide the easiest and quickest way to create DHTML behaviors using scripting languages such as Microsoft Visual Basic Scripting Edition (VBScript) and Microsoft JScript (compatible with ECMA 262 language specification). However, like any component used on the Internet today, behaviors implemented using Microsoft Windows Script Component (WSC) or Microsoft Visual C++.
The behavior used in the previous example to apply onmouseover event it's effect was implemented as an HTC and involves just a few lines of code. The code consists mainly of script, with a number of custom elements used to define the behavior. Notice that the use of the PUBLIC:ATTACH element that allows an HTC to listen in on events fired on the element on the page and to handle the events appropriately. So it provides the means to encapsulate the event handling code that would otherwise be put on the page.


<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="Hilite()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="Restore()" />
<SCRIPT LANGUAGE="JScript">
var normalColor;

function Hilite()
{
if (event.srcElement == element)
{
normalColor = style.color;
runtimeStyle.color = "red";
runtimeStyle.cursor = "hand";
}
}

function Restore()
{
if (event.srcElement == element)
{
runtimeStyle.color = normalColor;
runtimeStyle.cursor = "";
}
}
</SCRIPT>

Be the first one to comment on this page.




  XML Tutorial eBooks
More Links » »
 
 XML Tutorial FAQs
More Links » »
 
 XML Tutorial Interview Questions
More Links » »
 
 XML Tutorial Articles
More Links » »
 
 XML Tutorial News
More Links » »
 
 XML Tutorial Jobs
More Links » »

Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome Next

Keywords: XML DHTML Behaviors, internet explorer dhtml, internet explorer dhtml,xml web service

HTML Quizzes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizzes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright ? 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World | Important Websites
Copyright ? 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.