Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default Javascript tutorial

    Javascript is quite an old language now and is usually replaced by its more advanced and modern partners php, asp etc. but its still very useful in places and a good language to learn. It is useful for people with non php supported hosts such as freewebs because they can perform variable functions using javascript.

    So lets start off as all tutorials should! Lets say HELLO WORLD! To write a basic statement in Javascript you need to use the following code:

    Code:
    <script type="text/javascript">
    document.write("Hello World!")
    </script>
    this will the produce the statement in your browser Hello World! but this is the most simple state of javascript.

    Next we move onto variables. This is very much the same as php. See below:

    Code:
    <script type="text/javascript">
    var phrase = "Hello World!"
    document.write(phrase)
    document.write("<h1>"+phrase+"</h1>")
    </script>
    so here the script take the statement Hello World and in the document.write tag it more or less calls for it.

    Last I am going to show you the If statement. It goes something like this:

    Code:
    <script type="text/javascript">
    var d = new Date()
    var time = d.getHours()
    
    if (time < 10) 
    {
    document.write("<b>Good morning</b>")
    }
    </script>
    This simply checks the time and if it is before 10am then it displays the message Good morning. This can be very useful in welcoming messages on your site.

    Hopefully this will have given you a little insight into the world of javascript.

    [Edited By partie2] (Forum Moderator) Thread Stuck, Great Job
    Last edited by splintercell!; 13-08-2005 at 12:30 PM.


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  2. #2
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    very, very nice, i like it

    http://www.stupidian.com
    (contains mild swearing)

  3. #3
    Join Date
    Jul 2004
    Location
    Habbo Newsie Office
    Posts
    352
    Tokens
    0

    Default

    Wow I didn't know really javascript but now it does make since. I love it
    ABC = Alway Be Careful
    Check out!
    Habbo Newsie

  4. #4
    Join Date
    Sep 2004
    Location
    Essex!
    Posts
    1,650
    Tokens
    0

    Latest Awards:

    Default

    Great Job so ive moved the thread and stuck it in Website Tutorials Well Done

  5. #5
    Join Date
    Jun 2005
    Location
    USA
    Posts
    2,047
    Tokens
    0

    Latest Awards:

    Default

    VERY GOOD
    10/10

  6. #6
    .Lesley. Guest

    Default

    Really Cool!

    i dont think it works for myserver though

  7. #7
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by splintercell!
    Javascript is quite an old language now and is usually replaced by its more advanced and modern partners php, asp etc. but its still very useful in places and a good language to learn. It is useful for people with non php supported hosts such as freewebs because they can perform variable functions using javascript.
    Urmm im not sure if im misreading but javascript and php/asp are more aless complty differnt, and do complty differnt things, nether can do teh others job?
    Javascript is client size, so has controls to work once loaded to the user, wich are exicuted by the browser, say reszing screens active javascript content, that can change stuff without the need to reaload pages.
    Php/asp are server side, meaing none of it gets to the user, the host server, runs all the php or asp files, before it sends anything, and waht it does send is the pure dinamicly genoirated, but otherwize ordanry html file, possibly with javascript.

    so i dont get your comparson, its like comparing a image to aduio files "/

  8. #8
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    I really meant in a more basic sense such as with variables etc. Obviously javascript is cant do anything as advanced as php but in their basics they can be abit compared.


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  9. #9
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by splintercell!
    I really meant in a more basic sense such as with variables etc. Obviously javascript is cant do anything as advanced as php but in their basics they can be abit compared.
    Well javascipt can do things just as advanced as php, you cant get php to make someones browser bounce around the desk top, just as you cant get javascript to run a forum on "/
    Id still say the equal, overall and just serve diffent purpos's

  10. #10
    Join Date
    Sep 2004
    Location
    Liverpool
    Posts
    801
    Tokens
    0

    Default

    Wow That is pure class, I have never really noticed javascript as such a powerful language and thats just impressive!!
    "A stupid man's report of what a clever man says can never be accurate, because he unconsciously translates what he hears into something he can understand."

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •