Adobe ColdFusion 8

cfhtmlhead

Description

Writes text to the head section of a generated HTML page.

Category

Page processing tags

Syntax

<cfhtmlhead 
    text = "text">

Note: You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

See also

cfcache, cfflush, cfheader, cfinclude, cfsetting, cfsilent

Attributes

Attribute

Req/Opt

Default

Description

text

Required

 

Text to add to the <head> area of an HTML page.

Usage

Use this tag for embedding JavaScript code, or putting other HTML tags, such as meta, link, title, or base in an HTML page header.

If you use this tag after the cfflush tag on a page, an error is thrown.

Example

<!--- This example displays the information provided by the Designer & Developer Center XML
    feed, http://www..com/devnet/resources/_resources.rdf 
    See http://www..com/desdev/articles/xml_resource_feed.html for more information on this
    feed. --->

<!--- Set the URL address. --->
<cfset urlAddress="http://www..com/devnet/resources/_resources.rdf">

<!--- Use the CFHTTP tag to get the file content represented by urladdress. 
    Note that />, not an end tag, terminates this tag. --->
<cfhttp url="#urladdress#" method="GET" resolveurl="Yes" throwOnError="Yes"/>

<!--- Parse the XML and output a list of resources. --->
<cfset xmlDoc = XmlParse(CFHTTP.FileContent)>

<!--- Get the array of resource elements, the xmlChildren of the xmlroot. --->
<cfset resources=xmlDoc.xmlroot.item>
<cfset numresources=ArrayLen(xmlDoc.xmlRoot.xmlChildren)-1>
<cfloop index="i" from="1" to="#numresources#">
<cfset item=resources[i]>
<cfoutput>
<strong><a href=#item.link.xmltext#>#item.title.xmltext#</strong></a><br>
<strong>Author</strong>&nbsp;&nbsp;#item.creator.xmltext#<br>
<strong>Description</strong> #item.description.xmlText#<br>
<strong>Applies to these products</strong><br>
<cfloop index="i" from="1" to="#arrayLen(item.subject)#" step="1">
#item.subject[i].xmltext#<br>
</cfloop>
<br>
</cfoutput>
</cfloop>