Name: [3253] gasto
Member: 83 months
Authored: 41 videos
Description: C/C++ and python programmer. Some knowledge of graphic design too. Interested in Game Artificial Intelligence and Artificial Life. Currently studying(by myself)too many things to be worth the mention. Happy to contribute to the 'help-without-compensation-asked' community. I hope every one that r ...

The basics of Javascript. [ID:1485] (1/1)

in series: Javascript for beginners.

video tutorial by gasto, added 06/09

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

In this video I show the basics of Javascript.

The <script> tag begins in between the <head> tag. It could also be in between the <body> tag. That is why we call the message() function from within the onload attribute in the <body> tag (That is, when the page loads).

outputing simple text on the html page and alert boxes, defining a function and an if/else clause, gives us an immediate and general feel of what Javascript is.

I left some statements without the recommended ending semicolon, just to prove it can be done (Although we shouldn't in real programs!)

Note that Javascript has no relation to Java. It was a smart 'marketing' move from Netscape (when Java was in vouge) to attract developers.

Observe That I missed some semi-colons (;) on certain Javascript statements, that is legal, but highly discouraged. Left it as-is to show that no errors are detected by Mozilla FireFox.

Notepad++ will be our editor of choice for these tutorials.

<html>
<head>
<script type="text/javascript">
function message()
{
	alert("Great! First javascript experimentation!");
}
var aNumber;
aNumber = 26
// comments are very useful, syntax is just like C !
document.write("<h1>The main subject here</h1>");
document.write("<p>Normal paragraph starts here.</p>");
document.write("I am ", aNumber, " years old.")
/* Other type of comments.
Multiple line comments, also ignored by the interpreter!*/
var date = new Date();
var time = date.getHours();
if(time<10){
  document.write("<p><b>You are early at: </b></p>", time, "<b>AM </b>");
  }
else{
  document.write("<p><b>Good day!</b></p>")
  }

</script>
</head>
<body onload="message()">

</body>
</html>

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 7361 (since July 30th)
  • Plays in last week: 15
  • Published: 64 months ago

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>








All comments excluding tick-boxed quick-comments

Nice video!


Thank you very much for the video


47. Dale Jones Sat, 21 Aug 2010 18:57

nice tutorial!


extra , please more for beginers


Não rodou no meu IE


It's great.Thanks!


43. Jeewan Singh Fri, 30 Jul 2010 01:29

though the author don't seem to be a native English he has done a great job. looking forward to more of this


Its good but i needed lectures on more complex type of javascript.Looking for your help sir.


41. WaynePrime Wed, 23 Jun 2010 21:03

In your tutorial if u could display & explain the java script code and show the output HTML file at the same time by placing them next to one another it would be a great help at following your explanation.

Also when it comes to this javascript programming stuff I really need as many examples ranging from beginner to advanced. For now its the beginner level. See Datapig technologies website for a little insight.

Overall thanks for doing this!


great tutorial, perfect for a beginner like moi


If I could understand all that was going on, this probably was very well done. I am sure, that my lack of knowledge in C++/Python programming is the reason why I am lost.

I am going to continue to replay this and other sites that I have found so that I will start to gain better understanding.

Thanks


clear explanation. Thanks.


Nice intro tutorial.

I was looking for an intro to javascript example for our students. This was great.

Thanks


36. Dan Monsieurle Fri, 21 May 2010 06:40

Thanks very much, this was perfect for my level of noobness.


Good video. Simple, shows the basics, I will see more of his videos later.


34. tharindu Wed, 12 May 2010 11:21

That is really very good tutorial....


Thank U


32. anonymous Wed, 02 Dec 2009 23:06

Awesome intro covering most of the basics with some "Intermediate to Advanced" coverage. Nice delivery and sweet intro to basic Spanish.

Good work -- keep it up!


31. anonymous Wed, 25 Nov 2009 08:45

nice


30. anonymous Wed, 25 Nov 2009 07:34

ok


29. anonymous Sun, 22 Nov 2009 05:26

The tutorial is very easy to follow and you get alot of information in a quick time.


28. anonymous Wed, 18 Nov 2009 14:13

It is a good tutorial, i am from Peru, tnanks for your work


27. anonymous Sat, 14 Nov 2009 09:02

The first time he runs in, why does it say "I'm 10 years old" when he typed in 26?? The second time he runs it it displays the 26....weird


26. anonymous Sun, 08 Nov 2009 17:47

very nice. I'd like to hear more about the libraries standard and otherwise.


25. anonymous Sun, 08 Nov 2009 12:24

Thanks for a great video, very practical and easy for a beginner to understand!

Alan


24. anonymous Tue, 03 Nov 2009 12:05

Great lesson. Easy to understand.


23. anonymous Tue, 06 Oct 2009 16:07

Thanks for this wonderful illustrating video. Please, I would be so thankful if you provided more videos as soon as possible.


22. anonymous Fri, 25 Sep 2009 22:13

good beginning


21. anonymous Sun, 20 Sep 2009 00:22

Nice intro to Javascript


20. anonymous Wed, 16 Sep 2009 17:37

good tutorial


Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for gasto

Content

Feedback

Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.

feedback@showmedo.com