It dosn't work in Chrome! please change it for work in chrome

#1
<h2>Online Tajik (Cyrillic) to Latin converter</h2>

<form>  
Enter your words in Tajik (Cyrillic) :<br><br>
<textarea name="input" cols="50" rows="10" wrap="physical" >Забони Тоҷикистон ба лотин</textarea><br><br>    
<input type="button" value=" Convert to Latin" onClick="javascript:translate(this.form)"><br><br>
<textarea name="output" cols="50" rows="10" wrap="physical" ></textarea> 
</form>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
var letters = "ФИСВУАПРШОЛДӢТҲЗЙКҶЕГМҚЧНЯ0123456789 .ӮЮЖБХҒЭЁ\"";
var character = new Array(
"f","e","s","v","o","a",
"p","r","sh","o","l","d",
"ie","t","h","z","y","k",
"j","i","g","m","gh","ch",
"n","ya","0","1","2",
"3","4","5","6","7",
"8","9"," ",".","u",
"you","zh","b","kh","gh",
"ei","yaa"," ");

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;
 
    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;
 
    var newstr = string.substring(0,i) + by;
 
    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);
 
    return newstr;
}
 
function translate(form) {
 
form.output.value = "";
var input = form.input.value.toUpperCase();
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 += character[i] + "";

      }
   }
}
form.output.value = output;
}
</script>
0 Likes

#2

translate is a reserved function name in chrome (apparently. news to me, but that’s how its behaving). Use a different function name.

2 Likes

#3

Thank you !

0 Likes