Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

singingfish (7494)

singingfish
  (email not shown publicly)

Journal of singingfish (7494)

Monday April 23, 2007
11:49 PM

Javascript n00b part 1

[ #33085 ]

Unfortunately, javascript is a pain, but getting better. Unfortunately there seem to be a few good books out there, and none of them in my local library. Time to create my own resource for learning javascript! WTFM indeed. So following the advice of people who know, I downloaded the Core Javascript Guide. To give myself an interactive environment for learning Javascript I downloaded Firebug and off we go.

First up is the chapter on variables. Open up the Firebug inspector (a green tick in the lower rhs of my browser here) and declare a string in the interaction line (right at the bottom of the window with three blue angle brackets (>>>) like so:

a = "Hi";

Then: window.alert(a);

There we go, scalar variable naming and browser interactivity all in one go. Next up the rest of the chapter.

BTW while this isn't directly relevant to Catalyst, people do pop up on IRC asking for the "best javascript book" and the approach above seems a reasonable substitute.

Update: I found the little gray V at the far right hand side of the firebug eval area in firebug. Turns out you can eval blocks of code too :) :

a = 'foo'; b= 'bar'; if (a == 'foo' && b != 'bar') { window.alert(a)} else { window.alert(b) }

Update: (again). A little birdie tells me that I should declare my variables with var a = 'Hi'. Something to do with scoping issues. I guess once I understand how to do data structures in javascript I'll be working out scope and how to do something "use strict" like.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.