Jump to content

JavaScript/Basics: Difference between revisions

From IdeaWazaWiki
wikademia>Xora K Joken
Created Basics of First Lesson for Basic JavaScript
 
wikademia>Remi0o
mNo edit summary
Line 30: Line 30:
<br>
<br>
--[[User:Xora K Joken|Xora K Joken]] 19:18, 3 April 2007 (UTC)
--[[User:Xora K Joken|Xora K Joken]] 19:18, 3 April 2007 (UTC)
[[Category:Java]]
[[Category:Basics]]

Revision as of 00:09, 2 May 2007

Learning Basic JavaScript

What you should know - HTML/XHTML

Basics -
• JavaScript is the most popular web page scripting language and is suppported by almost every browser.
• It adds interactivity to your web pages.
• You can use only the tools all ready on your computer with out the need to download any software.
• It is easy and fun

First Lesson

Open up your text editor of choice and create a basic page. Now I am going to teach you how to write on your webpage using JavaScript.

<html>
<body>
<script type="text/javascript">
document.write("Hello World!")
</script>
</body>
</html>

As you can see JavaScript is added directly into your HTML by adding the <script> tag. You dont have to understand exactly how that worked, I'm about to explain. What you do need to know is this <script type"text/javascript"> tells the borwser that what ever you write between the that tag and the comsing </script> tag is JavaScript.

Now You alos need to know this JavaScript is case sensitive. What that means is what ever you type must be in cappatilized the way it should be. For example if you wrote <ScRiPt TyPe="TeXt/JaVaScRiPt"> not only would you waste alot of time, your browser would also have no idea what you did.
You are probably wondering when im going to explain the rest of what you did. Well, document.write is the JavaScript standered way of writing. You declaired where you wanted to be mesing with by typing document, then you told what you wanted to do on the document, also known as giving the command, with .write, then you told the the bowser what to do with the command, and in this case what to write with ("Hello World")
These are the absolute essentials to understand for starting JavaScript.
--Xora K Joken 19:18, 3 April 2007 (UTC)