jquery



jquery

0 0


jquery-training

A Slide Presentation on jQuery - https://slid.es/chetanraj/jquery

On Github rajchetan / jquery-training

jquery

Chetan Raj

AGENDA

  • About
  • Attributes
  • CSS
  • Events
  • Selectors
  • Traversing
  • AJAX

About

  • A Framework built over JavaScript.
  • jQuery is a fast, small, and feature-rich JavaScript library.
  • Faster DOM Traversal.
  • Useful for larger web applications.

How jquery works

$(document).ready({    // jQuery code goes here}) ;
  •  All the events should be defined in the document ready
  • Equivalent Code Snippet
$(function() {   // Handler for .ready() called.});

Sample jquery snippet

<!doctype html><html>  <head>    <meta charset="utf-8" />    <title>Demo</title>  </head>  <body>    <a class="foo">Foo</a>    <script src="jquery.js"></script>    <script>      $( document ).ready(function() {        $('.foo').click(function() {          alert( "Bar");        });      });    </script>  </body></html>

Attributes

    .addClass() - $('.foo').addClass('bar');    .attr()    .hasClass()    .html()    .prop()    .removeAttr()    .removeClass()    .removeProp()    .toggleClass()    .val()