The jQuery Basics

The Structure Of A Jquery Script

Typically, your scripts will follow the pattern shown in the following code snippet.

 
<!DOCTYPE html> 
<html>
    <head> 
        <script src="http://yourServer.com/jQuery/jquery.min.js"></script> 
        <script> 
            jquery code here
        </script> 
    </head> 
<body> 
  <p>Your tags here</p>
</body> 
</html>
  

The jQuery core function(factory object) is referenced as either

jQuery()

or

$()

$() is a "function".

It can accept:

  • a selector string
  • a string of raw HTML
  • a DOM element
  • an existing jQuery object

$() returns a jQuery object.

The jQuery object has several methods, for example, $.ajax() or $.each().

Home 
  JavaScript Book 
    jQuery  

Introduction:
  1. The jQuery Basics
  2. Pattern of using jQuery
  3. Chain methods jQuery
  4. Using jQuery with Other Javascript Libraries