Your SlideShare is downloading. ×
  • Like
Introduction to the wonderful world of JavaScript
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Introduction to the wonderful world of JavaScript

  • 1,009 views
Published

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.

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,009
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
12
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide






















Transcript

  • 1. Introduction to the wonderful world of JS. • JavaScript - pitfalls and gotchas • jQuery - a JavaScript library • Examples and questions
  • 2. Jakob Torp • @googletorp • Work in Reveal IT - mostly Drupal developer/consultant. • Drupal 1.3 years
  • 3. JavaScript pitfalls and gotchas
  • 4. 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.
  • 5. JavaScript happens in the browser.
  • 6. Boolean type conversions
  • 7. Object declarations. Last comma causes syntax error in IE
  • 8. Function declarations.
  • 9. Functions can be passed as variables.
  • 10. Functional scope
  • 11. Closure.
  • 12. jQuery a JavaScript library
  • 13. Why use a library? • Development framework like Drupal. • Reuse code - faster development. • Good documentation. • Help solve browser issues. • Help optimising your code.
  • 14. 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.
  • 15. DOM
  • 16. CSS selection VS:
  • 17. Events & eventhandlers • Events - user interaction: click, focus, blur ect. • Event-handlers - Execute code for specific events. (function).
  • 18. jQuery chaining jQuery returns jQuery
  • 19. Ajax simplified
  • 20. jQuery plugins Flot module
  • 21. 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()
  • 22. Examples & questions