Introduction to JavaScript and Browser DOM

Google TechTalks · 134K views · 2010 · 1:06:01

Open on YouTube

Web developmentPython, Ruby & scripting languagesProgramming language designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering beginner questions about JavaScript objects, constructors, prototypes and 'this', as a clear grounding in how the language really works.

Recommended by 4 people across 4 different months, 2012 to 2014.

What it is

A 2010 Google Tech Talk by Misko Hevery that explains how JavaScript works under the hood for newcomers. It covers objects as the core primitive, building classes and instantiation from them, how functions execute, the rules for 'this' and binding, and the async, non-blocking nature of browser APIs.

What people said

Strong rec rodrigo-silveira · 2012-01 · Stack Overflow · on “Is JavaScript object-oriented?”

Misko Hevery did an excellent introductory Google Tech Talk where he talks about objects in Javascript. I've found this to be a good starting point for people either questioning the use of objects in Javascript, or wanting to get started with them: Introduction to JavaScript and Browser DOM [this video]

Recommends mowwwalker · 2012-03 · Stack Overflow · on “Not a function?”

What you're trying to do is create an object for which the function is a constructor, but what the code is actually doing is setting the variable talk to a function. You want: function cat(name) { this.talk = function() { alert(" say meeow!" ) } } var myCat = new cat("felix"); myCat.talk() edit: Relevant javascript tech talk: [this video] He talks about constructing objects with functions at about 30 minutes in. The code he posts is: function Circle(radius){ this.radius = radius; this.area = function(){ return this.radius * this.radius * Math.PI; }; } var instance = {}; Circle.call(instance, 5); instance.area(); // ==> 78.5398 var instance2 = new Circle(5); instance2.area() // ==> 78.5398 instanc

Recommends neutron · 2013-02 · Stack Overflow · on “Very simple Javascript partial page refresh calling a .php page not working”

Make sure your blasty.php file is on the same domain. Also, to help debug javascript, right click in Chrome or Firefox and go Inspect Element. Then go to the Console window and it will display most errors. I also recommend this youtube video about javascript. I it helped me bridge the gap on some javasrcipt gotchas. [this video] Here is a link about debuggers: [LINK] As @Explosion Pills said, FireFox's Firebug is another great option. I will use both to help debug javascript. Firebug is nice because under the Net tab it will display the acutal http requests as they happen in the background, with the params, response, header info, etc. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Recommends Data · 2014-04 · Stack Overflow · on “__proto__ : function declaration versus object literal”

I've just started reading this article [LINK] and I'm stuck on the first paragraph: For the code: var foo = { x: 10, y: 20 }; we have the structure with two explicit own properties and one implicit proto property, which is the reference to the prototype of foo: Figure 1. A basic object with a prototype. My question... Why does the diagram show a foo prototype for a basic object literal? If I create two objects, it shows this isn't the case:- object one - a function object / constructor function object two - a basic object literal with key/value pairs like a dictionary If I use the debugger, it shows that object one does indeed create a One.prototype which also has an Object.prototype further