fredag den 25. november 2011

JavaScript

Hey guys I'm here with a lesson with javascript with a few simple steps you can create your own website with javascript and html. I´m gonna make some of these steps little by little so be patient.


Lets get started. First make a new text document and save it as something.html.
Then type in the start out or what its called and the <script> tags <script type="text/javascript"> just means we are working with javascript


<html>
<head>
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>
______________________________________
Now I will speak to you about document.write(); its placed inside the <script> tag
document.write("if you have these things in it then this will be placed on the screen");
if you will show a variable then its document.write(x);
if both its document.write(x+" apples and im "+x+" years old");
______________________________________
Well you can´t use variables if you dont know how they work so first of all to make a variable
its simple just: var variableName = a number;
or: var variableName = a String; a string is a piece of text and the way to tell that its a
string is "I'm a string."
_____________________________________
now its functions they is a part the code you have to trigger
lets make a function its simple really
okay function functionName(){
code goes here
}
to call it you have to functionName();


Find me on thorulf@live.dk and I'll answer as good as I can