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().