-
please could you help me!!
could anyone of you smashing people tell me why this piece of code don't work??
thanks.
HTML>
<HEAD>
<TITLE>another go </TITLE>
<SCRIPT SRC=stringLibaryTMA.js> </SCRIPT>
<SCRIPT>
function isVowel(aCharacter)
/************************************************************************/
/* This function takes one argument, a string which consists of a */
/* single character. The function returns the Boolean value true if */
/* the character is one of a, A, e, E, i, I, o, O, u, or U. If the */
/* character is not one of these the function returns the Boolean value */
/* false */
/************************************************************************/
{
return
((aCharacter == 'a') ||
(aCharacter == 'A')||
(aCharacter == 'e') ||
(aCharacter == 'E')||
(aCharacter == 'i') ||
(aCharacter == 'I')||
(aCharacter == 'o') ||
(aCharacter == 'O')||
(aCharacter == 'u') ||
(aCharacter == 'U'))
};
{
isVowel()
var letter;
letter = window.prompt('enter','');
if (letter == 'isVowel')
{
document.write('true')
}
else
{
document.write('false')
}
};
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
-
Hi,
this version seems to work.
<HTML>
<HEAD>
<TITLE>another go </TITLE>
<SCRIPT LANGUAGE="JavaScript">
{
function isVowel(aCharacter)
{
return(
((aCharacter == 'a') ||
(aCharacter == 'A')||
(aCharacter == 'e') ||
(aCharacter == 'E')||
(aCharacter == 'i') ||
(aCharacter == 'I')||
(aCharacter == 'o') ||
(aCharacter == 'O')||
(aCharacter == 'u') ||
(aCharacter == 'U')));
};
}
{
var letter;
letter = window.prompt('enter','');
if (isVowel(letter))
{
document.write('true')
}
else
{
document.write('false')
}
};
</script>
</HEAD>
<BODY>
</BODY>
</HTML>
Enjoy.
Hope this helps
Graham
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, and if they get mad, you are a mile away and you have their shoes ;-)
http://www.grahamrobinsonsoftware.com
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks