Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sample.html
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
<title>JavaScript Sample</title>
<script src="Sample.js" type="text/javascript"></script>
</head>
<body>
<form name="CustomerData">
<input type="text" id="PhoneNumber"></input><input type="button" value="Parse this US number" onclick="CustomerData.PhoneNumber.value=ParseUSNumber(CustomerData.PhoneNumber.value)"></input>
</form>
</body>
</html>
Sample.js
function ParseUSNumber(PhoneNumberInitialString)
{
var FmtStr="";
var index = 0;
var LimitCheck;
LimitCheck = PhoneNumberInitialString.length;
while (index != LimitCheck)
{
if (isNaN(parseInt(PhoneNumberInitialString.charAt(index))))
{ }
else
{ FmtStr = FmtStr + PhoneNumberInitialString.charAt(index); }
index = index + 1;
}
if (FmtStr.length == 10)
{
FmtStr = "(" + FmtStr.substring(0,3) + ") " + FmtStr.substring(3,6) + "-" + FmtStr.substring(6,10);
}
else
{
FmtStr=PhoneNumberInitialString;
alert("United States phone numbers must have exactly ten digits.");
}
return FmtStr;
}