Text not being displayed after calling a function. Easy problem, please help!
I'm coding a simple random sentence generator & this is the beginning part of what I'm trying to accomplish.
I created 3 different functions with 3 separate buttons & 3 separate text areas to display the noun, verb, or article once the button is pressed.
However, when I press a button, nothing shows up in the text area! Can someone please tell me what I'm doing wrong & give me a fix? It has to be a simple problem, but I am very very new to this & need help. Thanks in advance!
You can combine all three <script...> sections into one
<script type="text/javascript">
// your code
</script>
But I do not see where you have RandomOneOf() function defined.
Probably failing because it cannot find the function.
What kind of errors are you getting in error console if using FF
or any kind of alert message using MSIE browser?
Thank you for the replies! I am following a set of guidelines (its a project for school) & was supposed to link an external javascript file into the code. I feel pretty stupid, but your help was greatly appreciated. I also got rid of the extra <script> tags.
If I wanted to create a function called "sentence" that called each of the three previous functions in order to generate a random sentence with the form "article"+"noun"+verb", how would I do that?
Bookmarks