Javascript function ( 4 Views )
-
I am trying to create a language translation function which currently allows the user to enter a single word for translation, using a SWITCH statement:
I want to enable the user to submit complete phrases which will return translated phrases, similar to that used on babelfish. I just cant figure out how to get it to accept phrases and return the translated phrase.
This is similar to what I have now:
function asd(word)
{
document.f1.sWord.value= word
}
function translate()
{
var e= document.f1.eWord.value ;
e= new String(e) ;
e= e.toLowerCase();
switch (e)
{
default:
asd('DONT KNOW THAT ONE')
break;
case 'what':
case 'how':
asd('como')
break;
case 'who':
asd('quien')
break;
case 'theater':
asd('cine')
break;
case 'breakfast':
asd('desayuno')
break;
}}
(engin, Norway)
Related Topics ... (or search in 1.720.883 topics !)
private function calling public function – oo javascript (13) calling a php function within a javascript function (7) javascript function has no properties in javascript console (3) javascript function to disable inline javascript? (4) javascript function inside javascript (7) function with in a function in javascript (2) javascript function help (1) javascript function (4) help with javascript function (8)
copyright © 2007-2031 Pfodere.COM ( 7 Pfoyihuee Online )
|