Introduction to the wonderful world of JavaScript
Upcoming SlideShare
Loading in...5
×
 

Introduction to the wonderful world of JavaScript

on

  • 1,226 views

An introduction to the world of JavaScript, covering some of the pitfalls and ending with a overview of jQuery, the js lib that ships with Drupal.

An introduction to the world of JavaScript, covering some of the pitfalls and ending with a overview of jQuery, the js lib that ships with Drupal.

Statistics

Views

Total Views
1,226
Views on SlideShare
1,204
Embed Views
22

Actions

Likes
1
Downloads
11
Comments
0

3 Embeds 22

http://www.slideshare.net 17
http://coderwall.com 3
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Introduction to the wonderful world of JavaScript Introduction to the wonderful world of JavaScript Presentation Transcript

  • Introduction to the wonderful world of JS. • JavaScript - pitfalls and gotchas • jQuery - a JavaScript library • Examples and questions
  • Jakob Torp • @googletorp • Work in Reveal IT - mostly Drupal developer/consultant. • Drupal 1.3 years
  • JavaScript pitfalls and gotchas
  • JavaScript OO programming language • Object oriented. • No relations to Java. (LiveScript) • Purpose is to make the browser interactive. • Created by NetScape in 2 weeks! • Reverse engineered by Microsoft. (browser war) • Official name: ECMAScript.
  • JavaScript happens in the browser.
  • Boolean type conversions
  • Object declarations. Last comma causes syntax error in IE
  • Function declarations.
  • Functions can be passed as variables.
  • Functional scope
  • Closure.
  • jQuery a JavaScript library
  • Why use a library? • Development framework like Drupal. • Reuse code - faster development. • Good documentation. • Help solve browser issues. • Help optimising your code.
  • jQuery motto “write less do more” • DOM - Document Object Model. • CSS selection - fast and easy (Sizzle) • Event handlers - click, focus etc. • AJAX & animations • Plugins - works like a Drupal module.
  • DOM
  • CSS selection VS:
  • Events & eventhandlers • Events - user interaction: click, focus, blur ect. • Event-handlers - Execute code for specific events. (function).
  • jQuery chaining jQuery returns jQuery
  • Ajax simplified
  • jQuery plugins Flot module
  • drupal_add_js() • Add your own js file on a given page. • Add PHP variables to the global Drupal variable. • Possible to set scope and other options. • Edge case, drupal_get_js()
  • Examples & questions