COMP 20: Web Programming

jQuery

Why Use a Good JavaScript Library?

Why jQuery?

Getting Started: Two Ways

  1. Download jQuery and include it in your HTML pages: <script src="jquery-2.1.3.min.js" ></script>
  2. Use jQuery via Google Code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>. Of course, you have to be connect to the Internet and have to depend on Google being up!

Launching Code on Document Ready

 $(document).ready(function(){
   // Your code here
 });

Selectors

Syntax

Magic Selectors

HTML Manipulation

Attributes

Changing the Class of Elements

CSS

Events

Special Effects

DOM Traversal

Ajax