<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005-2010 Roderick Divilbiss">
<title>Highlight Glossary Terms</title>
<script type="text/javascript">
var terms = new Array();
terms[0] = ['FBI','Federal Bureau of Investigation','definition.asp#fbi'];
terms[1] = ['e-mail','electronic mail','definition.asp#email'];
terms[2] = ['phony','not true, fake.','definition.asp#phony'];
function highlightGlossaryTerms(){
// AVOID <a...>..</a> tags
var temp = document.getElementById('theExample').innerHTML;
var tmpBody = new Array();
// segregate the anchors
var cnt=0;
var inA=false;
var lookIn='';
var subBody;
var tmpStr;
while (temp.length>0) {
if ((temp.indexOf('</A>')>-1)||(temp.indexOf('<A')>-1)) {
if (inA) {
tmpBody[cnt]=temp.substr(0,temp.indexOf('</A>')+5);
temp=temp.substr(temp.indexOf('</A>')+4);
inA=false;
cnt+=1;
}else{
tmpBody[cnt]=temp.substr(0,temp.indexOf('<A')-1);
temp=temp.substr(temp.indexOf('<A')-1);
inA=true;
lookIn+=''+cnt+',';
cnt+=1;
}
}else{
tmpBody[cnt]=temp;
temp='';
lookIn+=''+cnt+',';
}
}
lookIn=lookIn.substr(0,lookIn.length-1);
for (var idx=0;idx<terms.length;idx++){
for (var hdx=0;hdx<tmpBody.length;hdx++) {
if (lookIn.indexOf(hdx)>-1) {
subBody=tmpBody[hdx].split(terms[idx][0])
tmpStr=subBody[0];
for (var jdx=1;jdx<subBody.length;jdx++) {
tmpStr+='<a href="'+terms[idx][2]+'" class="terms" title="'+terms[idx][1]+'">'+terms[idx][0]+'<\/a>'+subBody[jdx];
}
tmpBody[hdx]=tmpStr;
}
}
}
tmpStr='';
for (var idx=0;idx<tmpBody.length;idx++)
tmpStr+=tmpBody[idx];
document.getElementById('theExample').innerHTML=tmpStr;
}
</script>
<style type="text/css">
.terms {
font-weight: bold;
background-color: #FFFF66;
text-decoration:underline;
color:#800000;
}
</style>
</head>
<body>
<div id="theExample">
<strong>Example:</strong>
The FBI's Internet Fraud Complaint Center (IFCC) reports a steady increase in complaints involving unsolicited e-mails directing consumers to a phony "customer service" Web site or directly asking for customer information. These scams are contributing to a rise in identity theft, credit card fraud, and other Internet-based frauds. E-commerce customers, including bank customers, have fallen victim to these scams.<br>
<br>
Phishing involves sending customers a seemingly legitimate e-mail request for account information, often under the guise of asking the customer to verify or reconfirm confidential personal information such as account numbers, social security numbers, passwords, and other sensitive information. In the e-mail, the perpetrator uses various means to convince customers that they are receiving a legitimate message from someone whom the customer may already be doing business with, such as a bank. Techniques such as a false “from” address or the use of seemingly legitimate bank logos, Web links, and graphics may be employed to mislead the customer. After gaining the customer’s trust, the perpetrator attempts to convince the customer to provide personal information and provides one or more
methods for the customer to communicate that information back. For example, the e-mail might include a link to the perpetrator’s Web site that contains a form for entering personal information. Like the e-mail, the Web site is designed to trick the customer into believing it belongs to the bank. Alternatively, the e-mail might simply include an embedded form for the customer to complete. The ultimate goal of this fraud is to use the customer information to gain unauthorized access to a customer’s bank or financial accounts or to engage in other illegal acts.<br>
</div>
<script type="text/javascript">highlightGlossaryTerms();</script>
</body>
</html>
Date Validation Using JavaScript .
Cross-Browser Clipboard Copy .
Loading Images With Remote Scripting .
Why JavaScript In Hyperlinks Is Bad .
Change The Submit Button To Show Waiting For AJAX Response .
European Date Validation Using JavaScript .
Database Results To Client Side Array .
Reading Files With JavaScript .
AJAX For Plain Text And HTML .