All I ever wish is that you will gain something from the examples I wrote in this blog. If you have suggestions, questions, or have a much better way of doing it, please feel free to drop your comments so I may also learn from it and also those who are crawling around this blog. Examples here are mostly about Unix/Linux administration and programming which varies from C, C++, C#, Java, Shell Scripting, PHP to Python and I hope I can post more.
Thursday, July 24, 2008
English to Bisaya Language Translator
This leads me to an idea of creating an online English to Bisaya Language Translator project using PHP... Do you think this is a great idea? I have seen that the number of tourist people here in Cebu and in some parts of the Philippines is growing and I think this online language translator can help them learn about our Bisayan or Cebuano language.
Wednesday, July 23, 2008
JavaScript onClick Event
This is another "Hello World" example using JavaScript. The example below is a html script that is embedded with a javascript that will display a message in a messagebox whenever the button is clicked.
Your javascript must be placed inside the <head> </head> section of your html code. The javascript code must also be enclosed with the tag <script> </script>. Inside the <script> tag, you need to set the language property to "javascript".
The script is simple, we declare a new function called greet() and when this function is called, it will call a javascript built-in function called alert(). The alert function will pop-up a messagebox displaying the string "Hello! How are you today?".
Now that we have our javascript, we need to call the greet() function whenever a certain event is triggered. In this example, we added a button in our html code and set the onClick event of this button to call the function greet().
You try clicking the "Hello World" button below to see the output of this script.
The Script
<html>
<head>
<title>Yet another Hello World</title>
<script language="javascript">
function greet()
{
alert("Hello! How are you today?");
}
</script>
</head>
<body>
<form name="Form1">
<input type="button"
name="btnGreeter"
value="Hello World"
onclick="greet()" />
</form>
</body>
</html>
The Output