Published: September 21, 2011
Updated: October 30, 2011
In the movie 2010 a Space Odyssey, when HAL begins to loose his memory he immediately starts reciting the song Daisy, Daisy. What was the significance of this song. As it turns out, teaching a computer to recite Daisy, Daisy was one of the first escapades of the original members of the hacker movement.
This reflection caused the author to recall the many programming classes taken over the course of an academic career that spanned over three decades. In most every introductory programming class taught to modern students, the first program that a learner develops is the Hello World program.
The purpose for writing this program is not to accomplish anything particularly unique; how many ways are there to direct a computer to display the phrase "Hello World" without using any special formatting techniques? That was a rhetorical question because the obvious answer is ... not many.
The purpose for writing the Hello World program is to simply lead the learner to discover how to generate output on a computer's display, regardless of the particular programming language studied. The program is not particularly difficult to develop. To display the phrase typically takes about one line of code in most programming languages. However, the preliminaries may add a few steps to the endeavor.
The following code snippet specifies one method to accomplish the task:
In the above programming line, document represents an object. Objects contain methods or actions that may be performed on those objects, and attributes or descriptors of the objects. The document object above includes the write method, which writes information to the Web page. The statement document.write("Hello World") takes the phrase Hello World and displays the phrase on the Web page, which happens to be the document.
Note: Using the document.write method after a Web page loads will cause the Web browser to create a new page to display whatever the browser is directed to display by the document.write() method.
Once you create a form in HTML you may like to act on the data at the client level before sending the data to a server.
The preceding code will not run on its own, however ... something is missing.
The following code snippet illustrates what is necessary to run the Hello World program in JacaScript, complete with the necessary HTML overhead:
Dumbledore's HTML Series
- Text Editors for HTML Programming
- Essential HTML Tags
An explanation of the four essential HTML tags. These four tags are required in every Web page.
- Create a HTML Table
The simplest answer is that a table is a collection of data items displayed in rows and columns; the intersection of a row and column makes up a cell. Learn how to add a HTML table to a Web page.
- Create a Simple Form in HTML
HTML forms help web designers add interactivity to their sites. Discover the methods to create HTML forms.
HTML is Tag-Based
The hello.html file contains five tag-pairs. These pairs are as follow:
Each HTML tag-pair comprise an opening and closing tag. The opening tag identifies a directive to the browser and the closing tag, preceded by a "/" character, delineates the end of the pair. Each tag is enclosed within the left and right carot characters "<" and ">". Once a tag is specified, the directive remains in effect until the browser encounters the closing tag so a tag pair may envelope other tag pairs.
In order to run the above program, you need to create a HTML file, which includes the above code; save the file with an extension .htm or .html, then open the saved file in a web browser.
If you have never written a program and would like to see the above code in action, simply open up notepad then copy the above code and paste it into your notepad screen. Save the file as hello.html then open the file you created. Your default browser will open and display "Hello World."
Web Design Sources
Learn PhP for the Server Side
- Simple Php Signup via HTML form, registration script plus code.
This php tutorial aims to provide a simple registration/signup script or code using HTML form and mysql database that you can use in your own PHP programmed sites.
More by this Author
This sample term paper was written to cover the topic of gathering requirements for a class in system development and design.
Learning to perform a proper analysis of Strengths, Weaknesses, Opportunities, and Threats (SWOT) is a necessary task to plan an organization's strategic direction. This sample term paper explores the construction of a...
No comments yet.