Author Topic: Javascript Tutorial 1 - Beginner's Guide  (Read 6663 times)

lordryan756

  • Citizens
    Voting Member
  • Posts: 255
  • Karma: 2
    • View Profile
    • Awards
Javascript Tutorial 1 - Beginner's Guide
« on: April 30, 2011, 06:09:47 PM »
Hello. I'm Ryan (obviously), and I write in Javascript. It's a fun, flexible system and I thought you guys should try it.

---Chapter 1---
~~Commands~~
Javascript uses different "commands" that tell different sections to do something. I'll give you a condensed/cut-down version.

document.write() - As the command says, it writes stuff. You can either write a variable(Covered later) or text (Within quotation marks) within the parentheses.
Spoiler: click to toggle

var  - This is used to set a variable (For those of those who skipped Science and Math, it's a type of "object" that can have any meaning) that can be called upon later on.
Spoiler: click to toggle

if - This is part of an "If/Then" statement. If you skipped Language Arts, an If/Then statement is like Dominoes. IF you knock down the first domino, THEN the rest will fall down too.
Spoiler: click to toggle

else - This command is related to the "if" statement. For example, IF variable is equal to (==) 5, document.write(Whatever), but, what if "variable" is NOT equal to (!=) 5? That is where "Else" comes in. It gives a second option.
Spoiler: click to toggle


---Chapter 2---
~~Syntax~~
Syntax is like Grammar. It is key to the Javascript language. Syntax is what keeps "Else" and "else" apart, just like having "too" and "to" seperate.

{Curly Braces} - These are used to contain command reactions.
Spoiler: click to toggle

(Parentheses) - This shows the parameters (the "boundaries" of the command) of what the command is to do.
Spoiler: click to toggle

;Semicolon; - Most people prefer to put these at the end of lines, to make it easier to tell where the line starts and ends.
Spoiler: click to toggle



---Sources---
~http://www.tizag.com/javascriptT/
~Various Google Resources

---Thanks to---
~Jubal - For helping me learn Javascript in the first place
~Dimos - For ideas and comments
~Tizag.com - For making that site in the first place and supplying precious knowledge

~~Corrections appreciated~~

Second tutorial to come soon.


« Last Edit: April 30, 2011, 06:10:20 PM by lordryan756 »

Jubal

  • Megadux
    Executive Officer
  • Posts: 35495
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Javascript Tutorial 1 - Beginner's Guide
« Reply #1 on: April 30, 2011, 06:40:45 PM »
Great start. What're you planning to add in tutorial two? :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

lordryan756

  • Citizens
    Voting Member
  • Posts: 255
  • Karma: 2
    • View Profile
    • Awards
Javascript Tutorial 1 - Beginner's Guide
« Reply #2 on: April 30, 2011, 06:57:58 PM »
I think how to actually string them together into an actual working script, along with the more complex commands (Random numbers, etc)