jquery introduction
What is jQuery?
JQuery is a JavaScript framework that makes writing advanced JavaScript very easy.
You can learn easily jQuery even you know basic knowledge in JavaScript. It has many useful JavaScript function to support cross browser JavaScript compatibility.
Where can you get it?
The official jQuery website (http://jquery.com) is always the most up-to-date resource for code and news related to the library. To get started, we need a copy of jQuery, which can be downloaded right from the home page of the site. Several versions of jQuery may be available at any given moment; the latest uncompressed version will be most appropriate for developers like you. You can find documentation here (http://docs.jquery.com).
How to install and run jQuery?
Since jQuery is a pre built function library in JavaScript, we can include normal external JavaScript files after downloading it from core jQuery web site.
1 2 3 4 5 6 7 8 9 10 11 12 | <html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//do magic with jQuery here
});
</script>
</head>
<body>
</body>
</html> |
What you can do with jQuery?
Easy Dom selectors (css, javascript, xpath, Dom).
Ajax.
Easy Dom manipulation
Easy Dom traversing
Use pre programmed number of jQuery plug-ins.
Cross browser supported event handling.
Utility functions.
Flash like animation.
And you can develop complex web applications with less coding….more.
How to use Magic method of jQuery $().ready or $(document).ready?
Generally browser loads external CSS and JavaScript files first and after loads the document element model and assigns corresponding objects by loading from server.
This loading of all objects called window load and when it completed browser triggers window.load event. But we can manipulate the document after the document element model. This event occurs before window.load event. Some A grade browsers supports this DOM ready event. So cross browser compatibility jQuery added this magic method to find the Dom ready event.
We call this method as below
1 2 3 | $(document).ready(function(){ alert(‘Dom loaded’); }); |
Document parameter is optional, if no parameter given jQuery assumes the document.
1 2 3 | $().ready(function(){ alert (‘Dom loaded’); }); |
Generally we call the window load event with jQuery as below,
1 2 3 | $(window).load (function () { alert (‘window loaded completely’); }); |









Related Articles
No user responded in this post
Leave A Reply