This Is A Very Simple Hello World Javascript Code Example

Forums » Javascipt » This Is A Very Simple Hello World Javascript Code Example
this is a simple hello world javascript script with code to show you how to create and make a simple hello world script using javascript for your broswer on the web
ok, so you want to start making javascript script. javascript is really fun because you can do alot of cool effects.

lets start my creating our first script.

i am using windows xp to write this tutorial, so open a blank notepad and copy and paste the following code into a blank notepad document

NOTE: if you dont have notepad, be sure to use an ascii text editor. dont use wordpad or a word process like word.exe, these programs format the text, and we dont want that. all microsoft windows come wint notepad, so you shouldn't use anything else.

JAVASCRIPT CODE:

<script language="javascript" type="text/javascript">
<!--
alert('Hello World Popup');
document.write('Hello Wallpaperama World! I wrote this message using javascript');
//-->
</script>


once you have copied and paste the code above, save it as: hello-world.html

now open hello-world.html with your browser, in my case, i am using internet explorer, but you can also use firefox if you prefer.

that's it, you will see your first script, the alert() function created the pop up you saw earlier, and the text on the browser was created by the document.write() function.

hope that helps

DEMO:

Title: This Is A Very Simple Hello World Javascript Code Example [806]
Tags: javascript create make hello world beginner newby howto sample example code script download free tutorial guide
By , 0 Comments