Archive for July 14th, 2008|Daily archive page
JQuery
What is jquery?
Is a javascript library that simplifies how you traverse HTML documents, handle events, perform animations and add AJAX to webpages. It is designed to change the way you write javascript.
What does minify mean?
Is the process of removing all unnecessary characters from source code with out changing its functionality.
Explain code how it differs from onload?
$(document).ready(function(){ // Your code here });
The ready event will bind a function and execute it once the DOM has loaded and ready to be manipulated. The ready event is replacement for the onload event, the onload event Is declared separate from the function where as the ready event can be declared within the function. The ready event can used as many times as the user wishes and is executed in the order they were added.
Chainability
Each method will return the jQuery object and will allow you to ‘chain’ upon it, which is allowing you to continue applying methods to the current set of elements.
Explain code and connection to AJAX?
$(“a”).click(function(event){
event.preventDefault();
$(this).hide(“slow”);
});
This is jQuery’s low-level AJAX implementation. $.get, $.post etc. for higher-level abstractions that are often easier to understand and use, but don’t offer as much functionality (such as error callbacks). $.ajax() returns the XMLHttpRequest that it creates. $.ajax() takes one argument, an object of key/value pairs, that are used to initialize and handle the request.
Leave a Comment