Madhacker's Guide to [Javascript] Intro. To the basics!

Discussion in 'Archives' started by madhacker14, Feb 21, 2009.

Madhacker's Guide to [Javascript] Intro. To the basics!
  1. Unread #1 - Feb 21, 2009 at 5:13 PM
  2. madhacker14
    Joined:
    Dec 14, 2007
    Posts:
    1,524
    Referrals:
    2
    Sythe Gold:
    9

    madhacker14 Guru

    Madhacker's Guide to [Javascript] Intro. To the basics!

    Intro.
    Hello my name is Madhacker, you can reffer to me as Hunter in this sections (User education), other then that no, its madhacker. This guide I am writing is one out of many web programming with java guides, I will be posting, please enjoy, rate, ask questions. Thats what I'm here for guys!

    Javascript is an object-oriented, client-side scripting language.​

    Things you need to know before we begin!

    • A basic understanding of HTML, dont know it, look for some great guides here on sythe (I reccommend learning from TDD's guides, or SuF's).
    What you need!

    • A web-browser that can use javascript (Internet explorer, netscape, and many others!)
      The mind power to push yourself over the limit to learn this =).
    You can practice your Javascript on notepad, or useing a few recommended website http://www.practiceboard.com/

    Table of contents.
    Sections one- (Was coverd above, the introduction).
    Section two- "Hello web-programming world!"
    Section three-Your introduction to Vars (Variables)
    Section four- Use those variables for "operators"

    Hello web-programming world!
    Yes, ask me anytime I will say the same thing. Your first duty as your learning a programming language, is the create a "Hello world!". If you dont, your just weird.

    Anyways, its simple.
    Code:
    <html>
    <head>
    <script type="text/javascript">//Its now saying HEY this is now javascript property so now you can properly execute your commands in this case we have to use text/javascript or it wouldn't display the text hello world
    document.write("Hello world!")//Writes an output to the page
    </script>
    </head>
    </html>
    
    As you can see we start off, as though we are about to write out as HTML, but the script type changes as I put <script type="text/javascript">

    Introduction to variables (vars)
    In this section i will reffer "variables" as "vars", most programmers do this so I would get use to it.
    This is probably the most simplest section of my guide, it just like simple pre-algebra.
    Code:
    var j=600//As you can see nothing usefull right now, we will in the next section though.
    var u=5//As you see, we give the variable a letter, and we assign that letter a number, or a value as you may say, we can also do an object and give it a value.
    var favbook=HarryPotter//Getting it yet?
    
    Operators
    Okay, you may be thinking now "What the hell can I do with var x=5"?
    I mean seriously, it does nothing for you.
    Untill you use that variable for something usefull!
    Operators is fun, and simple.
    Code:
    t+r=v//simple example, you have one variable, add it, subtract it, whatever to the other varable, and get the answer of the other variable, in this case "v".
    
    Code:
    
    <html>
    <body>
    <script type="text/javascript">
    q=5*5;
    document.write(q);
    document.write("<br />");
    </script>
    </body>
    </html>
    
    
    As you can see you actually did something with your variable.
    (You should have the resuly "25" on your screen)

    As of now I must come to a conclution for today. This is my first guide, I would like to know how I did, perhaps send some feedback, tell me how I can improve, and tell me if I should bother making more guides for Javascript.
    Thank you.
    Any questions, post here.
     
< Selling mining pure | [Swap] My main for ur pure [swap] >

Users viewing this thread
1 guest


 
 
Adblock breaks this site