html

Fading alerts in JavaScript

Thursday, February 15th, 2007

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>
<head>
<title>Fade In Text</title>
<style type=”text/css”>
body, table, div{color:#333;font:bold 11px Verdana, Arial, sans-serif;}
.title{background:#F2F2F2;border:1px #CCC solid;padding:5px;text-align:center;}
.tblFade{border:1px #333 solid;width:150px;margin:175px;}
.fadeElem{height:20px;display:block;position:relative;border:1px #CCC solid;padding:3px 10px;}
</style>
<script type=”text/javascript”>
<!–
var fadeSteps = 20;
var fadeDelay = 20;
var nextSetDelay = 1000;
var loopPrepend = true;
var arMessage = new Array(”Fade-In Message 1″, “Fade-In Message 2″, “Fade-In Message 3″, “Fade-In Message 4″, [...]

XSLT to strip HTML

Saturday, February 4th, 2006

<!–
strip_HTML
removes all HTML from a given value (including tags that may be left open-ended when returned by the db)
–>
<xsl:template name=”strip_HTML”>
<xsl:param name=”value”/>
<xsl:choose>
<xsl:when test=”contains($value,’&lt;’)”>
<xsl:value-of select=”substring-before($value,’&lt;’)” disable-output-escaping=”yes”/>
<xsl:choose>
<xsl:when test=”contains(substring-after($value,’&lt;’),’&gt;’)”>
<xsl:call-template name=”strip_HTML”>
<xsl:with-param name=”value”><xsl:value-of select=”substring-after($value,’&gt;’)”/></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=”$value” disable-output-escaping=”yes”/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Keep on coding