22jquery-2up - 22 jQuery 30 Sept, 2010 CSCC09F Programming...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
22 jQuery 30 Sept, 2010 CSCC09 Programming on the Web 1 22 jQuery CSCC09 Programming on the Web 1 jQuery motivation, binding, event handling, reading and writing DOM elements CSCC09F Programming on the Web 22 jQuery CSCC09 Programming on the Web 2 Why jQuery? b Isn’t this course about learning the fundamentals, not frills? Can’t we do everything necessary in plain JS + DOM? b Yes, but … writing JavaScript code is a tedious, time-consuming, and error-prone process, e.g.: c significant effort required for DOM navigation c need to accommodate browser differences c unexpected effects due to browser loading order c lack of mature tools to support development b Why jQuery, not Prototype, Scriptaculous, or … ? jQuery most widely adopted, lots of momentum
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
22 jQuery 30 Sept, 2010 CSCC09 Programming on the Web 2 22 jQuery CSCC09 Programming on the Web 3 Why jQuery? 22 jQuery CSCC09 Programming on the Web 4 Why jQuery? b A few reasons why jQuery seems more powerful (less effort/smaller code) and easier to use than other libraries: c Queries can be chained together (each jQuery returns itself so you can chain them together) for complex tasks c arrays/collections of results can be used as a single unit eg: $('.tab').hide() could hide all elements of class tab c The API, including its use of CSS selector notation, is intuitive, consistent, and common sense, so even with only a little knowledge you can usually achieve your desired result c jQuery has an extensible plugin architecture that has spawned a large community of plugin features useful for building RIA/Web 2.0 type applications b Some of these are matters of opinion, but there’s no disputing jQuery is now the most popular plugin
Background image of page 2
22 jQuery 30 Sept, 2010 CSCC09 Programming on the Web 3 22 jQuery CSCC09 Programming on the Web 5 Why jQuery? b Learning the fundamentals doesn’t mean we have to do everything the hard way (think back to Python in 1 st year, you used sort() before learning how to code it) b Simplifies code – which makes it easier to get right b With a single consistent interface you can control: c DOM interaction c Event handlers c Style properties b Consistency across browsers;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2010 for the course CS CSCC09 taught by Professor Alan during the Spring '10 term at University of Toronto- Toronto.

Page1 / 11

22jquery-2up - 22 jQuery 30 Sept, 2010 CSCC09F Programming...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online