JQuery Introduction

JQuery is a very fast, concise and cross-browser JavaScript Library that makes HTML document traversing very simple. You can achieve Ajax, UI, and event handling functionality with minimal efforts and clean code. If you are new to JQuery then this is the right place for your starting. You should have hands on experience of HTML and Javascript and CSS.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Demo</title>

</head>

<body>

<a href="http://jquery.com/">jQuery</a>

<script src="jquery.js"></script>

<script>

</script>

</body>

</html>

 

You have pointed to jquery.js which is the core file to start work with this Javascript library. We will talk about the main function which developer mostly used is window.onload. The following function will open the window with message “Welcome to JQuery”.

window.onload = function(){

alert("Welcome to JQuery"); }

 

Rethink, if your document is not ready or some files are needed to download first then what will happen, the above statement may cause some problems. JQuery overcome the problems with document.ready() method.

$(document).ready(function(){

alert("Welcome to JQuery");

});

 

The message window will display when the document would be ready to response the events. What document.ready() function do? It verifies whether the Document Object Model is ready which is called before the page finished the loading of images and other resources. You can attach several different functions on document loading using the ready() method.

$(document).ready(function(){

$("a").click(function(event){

alert("Enjoying JQuery with attaching the methods once!");

});

});

 

Resources:

http://jquery.com/

http://docs.jquery.com/Downloading_jQuery

Leave a comment