Step : 1
The First and foremost important step is the creation of a HTML Page and include the JQuery Library Script
<!doctype html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>
The jquery.js file can be an external reference or an internal reference in your own server.
External Reference :
A number of large enterprises provide hosted copies of jQuery on existing CDN networks that are available for public use. One can hotlink to these URL’s for external reference of Jquery script.
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
Internal Reference :
<script type="text/javascript" src="jquery.js"></script>
One can download and include the script for hosting it in his own domain.
Download JQuery from the
JQuery Download Page
Step : 2
Launching Code on Document Ready
Typically most Programmers use Javascript window.onload function to perform operations when the page is loaded.
A main drawback in this Javascript is that the script does not run until all the images are downloaded. Which is not what the programmers need. The reason for using window.onload in the first place is that the HTML 'document' isn't finished loading yet, when code is executed.
The Recovery of JQuery:
JQuery has a simple statement that checks the document and waits until it's ready to be manipulated, known as the ready event:
$(document).ready(function(){
// Your code here
});
This ready event forms the Key part of the JQuery Library. Inside this event many events can be called to manipulate the contents/ perform certain operations such as Click function…
$(document).ready(function()
{
$("a").click(function(event)
{
alert("Easy Jquey!");
});
});