Welcome Guest.   Make a donation to an author on the site October 23, 2014, 06:01:31 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Excellent Javascript Reference  (Read 7097 times)
housetier
Charter Honorary Member
***
Posts: 1,321


see users location on a map View Profile Give some DonationCredits to this forum member
« on: December 05, 2008, 07:28:22 PM »

The other I came across an awesome reference about the Javascript programming language.

Those articles help to get a deeper understanding of javascript and provide many examples.

And if you like you can download the articles as PDF! thumbs up
Logged
allen
Charter Member
***
Posts: 1,173



Powered by Beard

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: December 05, 2008, 09:05:10 PM »

I'm very, very rusty/novice in the JavaScript department--it has long been an embarrassing matter of fact and something I've wanted to rectify.  I've got a brand new, shiny text editor to play with and need something to do to put it through it's paces, may as well give this a look-see.  Thanks for the heads up.
Logged
housetier
Charter Honorary Member
***
Posts: 1,321


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 05, 2008, 09:10:34 PM »

If you want to use javascript to pep up websites, do consider using jquery. It will make your life a lot easier :-)

I guess solid knowledge of javascript can also come handy when developing XUL applications or extensions.
Logged
allen
Charter Member
***
Posts: 1,173



Powered by Beard

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 05, 2008, 09:14:08 PM »

It's solid understanding I'm after, specifically.  My problem is getting started. I drag my feet. Once I find a happy launch pad, I'm insatiable. . .

Slow starter.

And I hate libraries. (Reason I've haven't delved into ruby: rails)

I'm starting to feel like I'm inclined toward counter-productivity...
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #4 on: December 06, 2008, 01:09:46 AM »

I'm finding Douglas Crockford's materials (videos and posts) to be pretty decent -- I learned about these via a post by tinjaw.

I also found A re-introduction to JavaScript by Simon Willison to be helpful.

My two local currency units smiley
Logged
housetier
Charter Honorary Member
***
Posts: 1,321


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 06, 2008, 07:31:02 AM »

The re-introduction was quite informative! Thanks for the hint.
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 08, 2008, 06:24:13 AM »

Thank you for sharing in your original post!

(Tangential note: I just noticed how the Douglas Crockford videos were mentioned in the "Additional Resources" section of  "Essential Javascript -- A Javascript Tutorial".  From watching some of those videos I was under the impression that "getElementByID" is incorrect while "getElementById" is correct -- I see both on the "Essential..." page.  I guess that one is really easy to get wrong.)
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #7 on: December 18, 2008, 06:57:54 AM »

FWIW, I think the following from the "re-introduction" may be mistaken:

Quote
JavaScript distinguishes between null, which is an object of type 'object' that indicates a deliberate non-value, and undefined, which is an object of type 'undefined' that indicates an uninitialized value — that is, a value hasn't even been assigned yet.

From the ECMA 262 Standard:

Quote
4.3.9 Undefined Value

    The undefined value is a primitive value used when a variable has not been assigned a value.

4.3.10 Undefined Type

    The type Undefined has exactly one value, called undefined.

4.3.11 Null Value

    The null value is a primitive value that represents the null, empty, or non-existent reference.

4.3.12 Null Type

    The type Null has exactly one value, called null.

Perhaps the text in the re-introduction is a result of the weirdness (broken-ness?) of the typeof operator.  According to:

https://developer.mozilla...Operators/typeof_Operator

typeof returns "undefined" for values (there's only one as I understand it - undefined) of type Undefined but it returns "object" (!!) for values (again only one - null) of type Null.

On a related note, I came across the following at:

http://javascript.crockford.com/recommend.html

Quote
typeOf

The typeof prefix operator returns a string based on the type of its parameter. Unfortunately, it provides the wrong result if the operand is null or an array.

The new typeOf global function is intended to replace the defective typeof operator. It produces the same result as typeof, except that it returns 'null' for null and 'array' for arrays.

It can be implemented in JavaScript:

function typeOf(value) {
    var s = typeof value;
    if (s === 'object') {
        if (value) {
            if (typeof value.length === 'number' &&
                    !(value.propertyIsEnumerable('length')) &&
                    typeof value.splice === 'function') {             
                s = 'array';
            }
        } else {
            s = 'null';
        }
    }
    return s;
}
« Last Edit: December 18, 2008, 07:03:27 AM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 18, 2008, 07:42:56 AM »

I also came across the following today and so far am finding it to be pretty good too:

http://www.jgharris.demon...o.uk/jsfeats/JSfeats.html

Although I'm not sure about the following bit:

Quote
In outline, each object is a collection of properties. Each property has a name and a value. The value can be any member of any of the javascript types.

I've been under the impression that the value portion of a property can not have the value of undefined -- as I understand it, undefined is what is returned if one attempts to access a non-existent property.

Edit: this impression seems faulty -- at least testing under Firebug using Mozilla, it looks possible for a property's value to have the value of undefined.  Time for hasOwnProperty() and possibly additional code perhaps...

Edit 2: I think I know where I picked up my initial impression -- I think it may have been in the first video of Douglas Crockford's series "The JavaScript Programming Language" -- specifically, there is a slide titled "Dynamic Objects" which contains some text: "A name can be any string, a value can be any value except undefined"
« Last Edit: January 03, 2009, 04:15:37 AM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #9 on: December 19, 2008, 11:07:07 PM »

A Crockford piece of an overview nature:

  http://javascript.crockford.com/survey.html

FWIW, I'm finding a combination of the following to be quite helpful in developing my understanding of JavaScript:

  • reading more than one of these overviews (and on more than one occasion)
  • dipping into ECMA 262 for clarification
  • use of Firebug to test/verify code samples

Edit: I should add one more item to the list: at least one concrete project to test ideas out on -- in my case FARR plugins via ecaradec's FScript (plus examining czb's myriad plugins) has been quite informative.
« Last Edit: December 21, 2008, 02:52:01 AM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #10 on: January 02, 2009, 07:44:46 PM »

On a related note, I came across the following at:

http://javascript.crockford.com/recommend.html

Quote
typeOf

The typeof prefix operator returns a string based on the type of its parameter. Unfortunately, it provides the wrong result if the operand is null or an array.

The new typeOf global function is intended to replace the defective typeof operator. It produces the same result as typeof, except that it returns 'null' for null and 'array' for arrays.


I came across the following entry at Crockford's blog:

Quote
Mark Miller of The Google, by closely reading the ECMAScript standard, has discovered a simpler, more reliable test.

Object.prototype.toString.apply(value) === '[object Array]'
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #11 on: January 03, 2009, 08:46:46 AM »

Today I came across Eloquent JavaScript: An opinionated guide to programming by Marijn Haverbeke.  I haven't gotten very far in it, but I noticed that allen appears to have mentioned it earlier.

allen, did you end up going through the whole thing and do you have anything more to add regarding it?
Logged
allen
Charter Member
***
Posts: 1,173



Powered by Beard

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: January 13, 2009, 10:25:52 PM »

allen, did you end up going through the whole thing and do you have anything more to add regarding it?

What I did read, I enjoyed -- he's obviously quite passionate about the subject and seems to cover things pretty well. I haven't actually gone through the whole thing though--have mostly been reading Pro JavaScript Techniques (physical book) by John Resig. No opinion on that yet.
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #13 on: January 14, 2009, 07:00:30 AM »

Thanks a lot for your comments about "Eloquent JavaScript".  I've made it through chapter 2 and my feeling so far is that the author seems to understand JavaScript pretty well and seems technically competent, but I am left wondering whether this is a good reference for my purposes. 

So far I feel like he is covering things too much (even things perhaps it might be better not to bother with -- e.g. the use of == <- why not always just use === ?).  May be I am saying this because I have become brainwashed by Crockford's line of using just particular portions of JavaScript smiley  However, I'm thinking of continuing for a while longer before deciding whether to stop.

The Jon Resig book you mentioned was one I was curious about -- but I am actually more curious about his upcoming book "Secrets of the JavaScript Ninja". 

Incidentally, I am in the middle of watching a talk by him titled "Advancing JavaScript with Libraries" (MDC link, Ajaxian link).  Are you familiar with this one?
Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #14 on: January 21, 2012, 01:32:26 AM »

I resumed reading recently and managed to make it through chapters 3 and 4.  The extended cats example in chapter 4 is fun smiley

Still haven't found a single resource I would recommend for learning JavaScript.  I like this book, but perhaps it could use some supplemental material regarding the idea of avoiding certain parts of the language.

On a tangential note, came across Smooth CoffeeScript which appears to have "mixed in" content from Eloquent JavaScript.  Anyone given this a read?
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.045s | Server load: 0.16 ]