Faircube Networks - Custom programming projects, internet consulting, web design, and various other multimedia and graphic design solutions.
 
Home arrow Javascript arrow Your first Hello World! JavaScript application
Your first Hello World! JavaScript application

It would be interesting to make the page a little more dynamic. Both of the major browsers, Netscape Navigator and Microsoft Internet Explorer, support JavaScript, a scripting language that is perfect for adding interactive features to a Web page. Take a look at the following snippet of code:


<html>
<script>

//hello world
//the classic first program

alert("hello world");

</script>
</html>

 

Here's an example where dynamic variables are used.

 

<html>
<head>
<title>Hello Joe</title>
</head>
<body>

<h1>Hello, John</h1>

<script>

//Hello John
//Demonstrate basic variable concepts
//John Doe - 01-01-2007

var greeting;

greeting = "Hi there, John";

alert(greeting);

</script>
</body>
</html>

 

If you would like to prompt the user for their name, here's the code to greet them by their name. 

 

<html>

<head>

<title>Hello User</title>

</head>

<body>

<h1>Hello, User Name</h1>

<script>

//hello user - Ask user for name

var userName;

userName = prompt("What is your name?");

alert(userName);

</script>

</body>

</html>

 

 
 
Home | Services | Portfolio | Support | Prices | About Us | Privacy | Terms | Website Resources | Legal
Copyright © 1999-2007 Faircube Networks Inc. All Rights Reserved.