Replace (tagname) with the actual tag name. When an end tag with that tagname is encountered, this function is executed after any other end tag programs assigned to the element. For example, use the function name onEndTag_textarea if you want the function to execute when a "textarea" end tag is encountered. (New v10.9912)

NOTE: Although most function names are case-sensitive, the (tagname) part of this function name is case-insensitive.

Example 1:

This example generates error messages for missing meta tags.

Because the default configuration file sets variable names based on which meta tags are used, the variables can be used to check to see if there are any missing meta tags in the head section.

function onEndTag_head() {
 $metaname="dcterms.title"; checkMetaDataExists();
 $metaname="dcterms.subject"; checkMetaDataExists();
 $metaname="dcterms.language"; checkMetaDataExists();
// checks to make sure there's meta data for $metaname
function checkMetaDataExists() {
 if !isDefined($varname) { Message(1,MSG_ERROR,'Missing a "'+$metaname+'" meta tag.'); }

Example 2:

This example generates a message if the document's title is over 100 characters.

function onEndTag_title() {
 if getValueInt(41)>100 {
  MessageEx(5,2014092900,MSG_WARNING,$SEARCHENGINE,"This document's title is "+getValueInt(41)+' characters and may be too long.',getLocation(3));