Javascript, Jquery and Jquery Ui: Presentation By: Tom Friedhof
Javascript, Jquery and Jquery Ui: Presentation By: Tom Friedhof
and jQuery UI
presentation by: Tom Friedhof
What is JavaScript?
What is JavaScript?
Client Side Scripting Language
JavaScript is not Java
Used to provide instant feedback
Better Usability
Richer Web Applications
Works the DOM (i.e. HTML, XML, etc...)
https://developer.mozilla.org/en/DOM
title
div
ul
li
li
li
div
div
div
Document
html
Element
head
id=tabs
Element
body
Element
Element
meta
title
Element
.innerHTML
div
Element
Element
Element
Element
ul
div
div
div
Element
Element
Element
Element
Element
Element
li
li
li
Element
Element
Element
EVENTS
onLoad
onClick
onMouseOver
etc...
http://www.w3schools.com/jsref/jsref_events.asp
Awesome!
We know the DOM
Now What?
JavaScript Libraries
encapsulate browser
inconsistencies.
jQuery
jQuery Basics
$( [find something] ).doSomething();
CSS Selector
jQuery Method
Good Luck doing this with just the DOM and JavaScript
jQuery.com
visualjquery.com
An Example
http://www.elated.com/articles/javascript-tabs/
Objective.
Turn an HTML Document with an
The CSS
is a helper
function that retrieves the first child of a given element that has a given tag
name.
getHash()
Demo
index_hard.html
Not a Computer
Science Degree
jQuery
and
jQuery UI
$(#tabs).tabs();
CSS Selector
jQuery UI Method
$(document).ready(function() {
// Code Goes Here
});
$(document).ready(function() {
$(#tabs).tabs();
});
Drupal.behaviors.loadTabs = function(context) {
// Code Goes Here
};
Drupal.behaviors.loadTabs = function(context) {
$(#tabs).tabs();
};
Ability to override JS
Behaviors are re-attachable
Attach Behaviors to a specific context
Drupal.attachBehaviors(elem);
Demo
index_easy.html
Demo
Drupal.behaviors
Resources
http://jquery.com and http://jqueryui.com
http://www.elated.com/articles/javascript-tabs/
http://api.drupal.org/api/file/developer/topics/javascript_startup_guide.html/6
http://raincitystudios.com/blogs-and-pods/katherine-bailey/the-lowdownjquery-drupal-part-two
http://www.chapterthree.com/blog/josh_koenig/
handling_aysnchronous_data_drupal_session_materials
https://developer.mozilla.org/en/JavaScript
Questions?