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"
How to write a javascript program
Started by
cbg
, Mar 05 2007 10:41 PM
#1
Posted 05 March 2007 - 10:41 PM
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"
#2
Posted 05 March 2007 - 10:53 PM
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 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
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.
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users