. .


Javascript 4 U 1: Hello World

November 1, 2010 6:54:47.488

Javascript 4 U

Welcome to Javascript 4 You - a new screencast series devoted to Javascript tutorials. We are starting with the basics - what is Javascript, and how can you get started learning it? Today's screencast introduces some basic concepts, which will be built upon as we go forward. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube.

Join the Facebook Group to discuss the tutorials. You can view the archives here.

To watch now, use the viewer below:

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Technorati Tags: , , , ,

[js4u1-iPhone.m4v ( Size: 3930919 )]

posted by James Robertson


Re: Javascript 4 U 1: Hello World

[anonymous] November 2, 2010 6:27:59.469

whoa up there!

what did we just do? -you didn't really explain it

what is this document.write? -i'm thinking, "is this a good first example for a user?"

compare this with some javascript that just does something


alert('hello world');

i think this latter is a much better

a) it makes the browser do something that it couldn't do via html

b) document.write is really a wierd html injection thing -i don't even think it should be used these days (ie when we have a dhtml browser ) -its also horribly confusing

also: i was very surporised by your electing to burden the new user with that "commenting out javascript in case the browser doesn't support it" nonsense -bleech!

also: IMO writing javascript in a text editor is good for a) absolute beginners and b)absolute experts -for my money, i hope you move to an ide in this series (i find that aptana is not bad (not great either, but this is javascript after all))


that annoying guy pete f

btw: javascript is HARD ..not the language -which is quite cute- but the environment(S) and the appalling subtle (or silent) errors that result from it trying to be "beginner friendly"

-learn Ruby instead :-) or at least buy crockford's "javascript, the good parts" book, and anticipate far more pain than you would think

Re: Javascript 4 U 1: Hello World

[W^L+] November 2, 2010 17:39:10.939

Even though I've used JS off and on since the late 1990s, I'd consider myself an (almost) absolute beginner. But I have used Aptana. Big. Bulky. Slow. And not very good at anything (as of a couple of years ago). I'll have to try it again, maybe it has improved.

I think that once you get past the point where a text editor is useful, you're ready to learn how to use one of the well-known frameworks. I don't think people hand-write most of their JavaScript anymore, they mostly tune it up and string together library calls. Still, the better editors have syntax highlighting, automatic indentation, automatic bracketing (if you want it), and all sorts of other functions that a bare Notepad clone will not offer. Makes it much easier to focus on the task at hand rather than spelling and remembering the specific capitalization of each keyword or function or variable.

You're right about document dot write being a form of HTML injection. But in a sense, starting with empty DIV elements and filling them through JS and CSS is not much different. There are better ways to do it (DOM manipulation, for instance), which generally also work with XHTML. (I remember hearing that document dot write wasn't supposed to work with XHTML anymore.) And it probably is better not to do it that way.

Useful functions vs document dot write: Yes, useful is better. I think James is learning JS too. Maybe your suggestions will help him improve faster.

RE "javascript is HARD": I perceived it as frustrating and limited, and until the last few years, not very useful beyond toy effects. That's why I never went any further with it. Hopefully, this series will spark a renaissance.

 Share Tweet This