The first thing that most Javascript programmers end up doing is adding some code to their program, similar to this:
window.onload = function(){ alert("welcome"); }
Inside of which is the code that you want to run right when the page is loaded. Problematically, however, the Javascript code isn't run until all images are finished downloading (this includes banner ads). The reason for using window.onload in the first place is due to the fact that the HTML 'document' isn't finished loading yet, when you first try to run your code.
To circumvent both problems, 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<br /> });
The remaining jQuery examples will need to be placed inside the ready event so that they are executed when the document is ready to be worked on. Add the next section of code:
$("a").click(function(event){ alert("Thanks for visiting!"); });
Save your HTML file and reload the test page in your browser. Clicking the link on the page should make a browser's alert pop-up, before leaving to go to the main jQuery page.
What is the main uses of the JQuery?
Selector Expressions : Hope we ll see brief in this post.
For made a action in a elment of a HTML document, we need to refer that particular element. Something like document.getElementById('myId'). JQuery will give u the simplied & more powerful selector expression to select a single or set of HTML elements.
DOM Traversal Methods
DOM Manipulation Methods
Event Methods
Effect Methods
AJAX Methods










Recent Comments