Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

How to write a javascript program


  • Please log in to reply

#1
cbg

cbg

    New Member

  • Member
  • Pip
  • 6 posts
Hi, I'm in a computer literacy class and um, I don't know much about javascript. It's confusing to me and my TA was not very helpful. I'm a beginner when it comes to computers.

Anyway, so we had an assignment where we had to make our own web page. Now the next assignment is to write a javascript program of my choice and add it to the web page. Can someone pleaaase write one for me? I guess it can just say "Welcome to my page. Hope you enjoy it"
  • 0

Advertisements


#2
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
Well Google turns up a lot if you care to look.

http://www.javascrip...rn/contents.htm Tutorial
http://homepage.ntlw...irstscript.html A very simple script.
http://www.codeproje.../jsbeginner.asp another Tutorial

And the list goes on...

A very simple script broken down.

document.write("Hello World");

document is an object. Anything you see on the page can be accessed as an object some how.

write() is a function, it does some action. In this case write something to a page.

"Hello World" is a string argument. It tells the function want to do, in the case write hello world. This can be a number, string or true or false or a variable.

An example of using a variable would be

var string = "Hello World";
document.write(string);

Edited by Michael, 05 March 2007 - 11:01 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP