The purpose of this plugin is to
provide the support needed to enable coolTip to
work in documents that are sent with a MIME type
of application/xhtml+xml. The reason that
this support is necessary is because a normal coolTip popup
generates its content using the innerHTML property.
In browsers that support this MIME type,
use of this property will cause an error and the browser
will not display anything. The way around this difficulty
is to create coolTips using W3C DOM procedures,
which this Plugin supplies.
The user not only needs this plugin but he/she must also
create documents that are well-formed and valid xml, of
which xhtml is a subset. What does this mean exactly? It
is not the purpose here to expound on xml
document structure
but basically for one used to creating HTML documents,
xml documents must:
- use tag and attribute markup that is lowercase (except
attribute values which can be mixed case)
- all markup must have opening and closing tags, except
for empty elements like br, img, hr,
etc. which are written as <br />, <hr
/>, and <img (attributes here)
/>. Note that there is a space character
before the forward slash character so that older browsers
will recognized these elements.
- all attrbute values must be quoted either in double
or single quotes and require a value such as nowrap="nowrap".
- attribute values can not contain either < or & characters
which must be written using their entity references -- < for < and & for &.
The greater than symbol (>) is okay
in an attribute value.
- the document must use one of the following DOCTYPEs
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
The xml header information is needed for a compliant
browswer to determine that it is being supplied with
an xhtml+xml document.
- and the document element (html element) must be:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> or
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
where the language attributes are recommended but not
required. [NOTE: A special thank goes
to Kiril
of MPN Development for clarifying the last two items above.] If a document does
not comply with these rules, then a compliant browser is
not obligated to load the document but will instead flag
the first error detected and then abort loading. To avoid
this problem, all documents should be run through the HTML validator at
W3C. It will be easier to pass validation if all javascript
coding is contained in an extermal file and then loaded
using:
<script type="text/javascript" src="thefile.js"></script>
In addition, if you are used to writing onMouseOver and onMouseOut,
to invoke an event, then get out of that habit because
an XML compliant browser will most likely ignore them because
they are not correct XML. Instead, you must write onmouseover and onmouseout.
Other things that may be a holdover from one's past
are using document.write() as the program
loads and not using the ending paragraph tags (</p>),
expecting the browser to supply it when it senses that
a new paragraph is starting. Both of these are no longer
possible. You can no longer use document.write() because
the browser just ignores it and the lack of a closing tag
is flagged as an error. In addition, the width and height attributes
on the TD element and the align attribute
on the TABLE element are marked as deprecated
in the HTML 4.01 specification and will be flagged when
trying to validate a document. If one must include javascript
in a document, then use the following approach:
<script type="text/javascript">
<![CDATA[
...
]]>
</script>
The markup <![CDATA[...]]> hides all characters from the XML parser so that just about anything is allowed.
To include support for this plugin, all that is needed
is to include the following two lines in the HEAD section:
<script type="text/javascript" src="cCore.js"></script>
<script
type="text/javascript" src="cXml.js"></script>
Download this
plugin as a zip file. |