This message was edited by mac_doggie at 2006-6-13 13:42:23
: : : hi, i am started uasing javasrcipt and i cant get how you use it. i tryied to create a simple web page but it did not work!. "<html>
: : : <head>
: : : <title>JavaScript Test</title>
: : : </head>
: : :
<script language="JavaScript">
: : : <!--
: : : function LoadMe() {
: : : var text = "Hello, World!";
: : : for (var i = 0; i < 10; i++) {
: : : document.write(text);
: : : }
: : : document.write("Ten lines of \'Hello, World!\'");[/green]
: : : }
: : : //-->
: : : </script>
: : : <body onLoad="LoadMe()">[/green]
: : :
: : :
: : : </body>
: : : </html>" how cant i learn how to use javasrcipt?
: : :
: :
:
GREEN Before you can call for a function you have to declare it. Try this out and see if it works.
:
PURPLEYou have to change the parenthesis. """" doenst work but "''" does. Mabye that's not what your looking for but I haven't looked through your code to much.
:
It's not very nice to place the script tag between the head and the body. (It's not W3C valid that way...) You'd better put it in the head or in the body of your document.
<head>
<title>JavaScript Test</title>
<script language="JavaScript">
<!--
function LoadMe() {
var text = "Hello, World!";
for (var i = 0; i < 10; i++) {
document.write(text);
}
document.write("Ten lines of \'Hello, World!\'");
}
//-->
</script>
</head>
<body onLoad="LoadMe()">
</body>
</html>
Also. THe function LoadMe() is called in the onload of the body, that means the function is already declared and implemented, so you shouldn't have any trouble executing the function... Do make sure you don't make any mistakes in cApTALs like LOADME() or loadme(), but LoadMe() if you declared the function as function LoadMe()

-mac-
mailto:mac_doggie@hotmail.com
the Netherlands...
BTW >> the first example did work....
And to answer your question... (how cant i learn how to use javasrcipt?)
There are many ways in wich you can't learn JavaScript, but I think you want to know how you can....