Best Download Sites Login
Site Login

Morse Code

Description
Converts an English word or phrase into it's Morse Code combination of dots and dashes. Analyzing each letter entered individually, as this script demonstrates, is a very useful JavaScript programming technique....View A Script Demo


Do you find it confusing setting up these script?
Java Scripts Magic can do all the hard work for you all At The Touch Of A Button.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="TextPad 4.4">
<LINK href="general.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web Site:  http://fineline.xs.mw -->

<!-- Begin
function translate(form) {
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .,?:-!";
morse = new Array(
".-","-...","-.-.","-..",".","..-.",
"--.","....","..",".---","-.-",".-..",
"--","-.","---",".--.","--.-",".-.",
"...","-","..-","...-",".--","-..-",
"-.--","--..",".-","-...","-.-.","-..",
".","..-.","--.","....","..",".---",
"-.-",".-..","--","-.","---",".--.",
"--.-",".-.","...","-","..-","...-",
".--","-..-","-.--","--.."," ",".-.-.-",
"--..--","..--..","---...","-....-","!");

form.output.value = "";
var input = form.input.value;
output = "";
for(count = 0; count < input.length; count++) {
daChar = input.charAt(count);
for (i = 0; i < letters.length; i++) {
if (daChar == letters.charAt(i)) {
output += morse[i];
break;
      }
   }
}
form.output.value = output;
}
//  End -->
</script>

</HEAD>

<BODY Background=../graphics/grayback.jpg>
<center><BR><BR><BR>
<form>
<table>
<tr>
<td align=center>
Please type your phrase in plain English<br>
<textarea name=input cols=50 rows=4 wrap=physical></textarea>
</td>
</tr>
<tr>
<td align=center>
<input type=button value="Translate!" onClick="javascript:translate(this.form)">
</td>
</tr>
<tr>
<td align=center>
<textarea name=output cols=50 rows=4 wrap=physical></textarea>
</td>
</tr>
</table>
</form>

</center>
</BODY>
</HTML>
 

Business Proposal If you have a Business Proposal that you think may be of interest to us here at Best Download Sites please contact us to discuss the matter in further detail