jQuery basics

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

2 Favorites

jQuery basics - Presentation Transcript

  1. jQuery basics
  2. who’s me? • Stijn Van Minnebruggen • Web Developer at These Days • twitter.com/donotfold • www.donotfold.be
  3. jQuery basics
  4. DOM
  5. DOM document object model
  6. The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Wikipedia
  7. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  8. DOM = HTML parsed by the browser as an XML structure
  9. server HTML browser DOM (xml) put simple: The browser gets HTML from the server and parses it to an XML like structure.
  10. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  11. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  12. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  13. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  14. <html> <head> <title>Wicked HTML page</title> </head> <body> <h1>Awesome!</h1> <p>Totally rad, dude.</p> </body> </html>
  15. javascript DOM
  16. view source ≠ view DOM
  17. javascript CSS
  18. javascript = FUN :) DOM x CSS
  19. javascript = FUN!
  20. javascript = HACKY!!
  21. why “hacky”?
  22. why “hacky”? • exists since 1995 (much happened, but not much has changed)
  23. why “hacky”? • exists since 1995 (much happened, but not much has changed) • browser differences
  24. why “hacky”? • exists since 1995 (much happened, but not much has changed) • browser differences • security, vulnerabilities
  25. why “hacky”? • exists since 1995 (much happened, but not much has changed) • browser differences • security, vulnerabilities • in comparison with other programming languages, it just is “hacky”... :)
  26. javascript libraries
  27. “javascript libraries make it easier for the user to make ‘hacky’ javascript work without too much hassle”
  28. javascript libraries
  29. javascript libraries
  30. javascript libraries Ample SDK, Cappuccino, Clean AJAX, Dojo Toolkit, Dhtmlx, Echo, Ext, Glow, Google Web Toolkit, Himle, Joose, Microsoft AJAX Library, Midori, Mochikit, OpenLink AJAX Toolkit, qooxdoo, Rialto, Rico, SmartClient, SproutCore, Spry Framework,Yahoo UI Library, ...
  31. $
  32. $ = jQuery
  33. $(selector)
  34. get a DOM element $(selector)
  35. get a DOM element $(selector).function();
  36. get a DOM element $(selector).function(); execute a jQuery function
  37. get a DOM element $(selector).function(parameters); execute a jQuery function
  38. $(selector).function(parameters);
  39. example: $(‘h2’)
  40. example: $(‘h2’) get all H2 DOM elements
  41. example: $(‘h2’).css();
  42. example: $(‘h2’).css(); execute the jQuery CSS function
  43. example: $(‘h2’).css(“color”, “#FFFFFF”);
  44. example: $(‘h2’).css(“color”, “#FFFFFF”); set the color to #FFFFFF
  45. example: $(‘h2’).css(“color”, “#FFFFFF”);
  46. selectors
  47. selectors • select DOM elements • select by ID • select by className
  48. selectors • select DOM elements $(‘div’) • select by ID $(“#myElement”) • select by className $(“.myClass”)
  49. manipulation
  50. manipulation • $(selector).html(“<h1>My title</h1>”); • $(selector).text(“My text, no <em>html</em>”); • $(selector).css(“border”, “2px solid red”);
  51. effects
  52. effects • $(selector).show(); • $(selector).fadeIn(); • $(selector).slideDown(); • $(selector).animate();
  53. Ajax
  54. Ajax • $.get(); • $.get(“myFile.html”, function(result) { $(“div”).html(result); });
  55. Plugins Everything you make in jQuery can be a plugin.
  56. Plugins Everything you make in jQuery can be a plugin. • Form validation • PNG fixes • ...
  57. demos
  58. your new best friend Online documentation docs.jquery.com Offline version (Adobe Air) api.jquery.com
  59. thanks! • Stijn Van Minnebruggen • Web Developer at These Days • twitter.com/donotfold • www.donotfold.be
SlideShare Zeitgeist 2009

+ Stijn Van MinnebruggenStijn Van Minnebruggen Nominate

custom

449 views, 2 favs, 1 embeds more stats

An introduction to javascript, jQuery and the DOM.

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 449
    • 303 on SlideShare
    • 146 from embeds
  • Comments 1
  • Favorites 2
  • Downloads 15
Most viewed embeds
  • 146 views on http://labs.thesedays.com

more

All embeds
  • 146 views on http://labs.thesedays.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories