-
Notifications
You must be signed in to change notification settings - Fork 1
Home
> What is jQuery?
IQuery is a JavaScript library fast, small and rich in resources, based on jQuery, however using the native capabilities of the browser. He does things like HTML document transverse and manipulation, event handling and Ajax much simpler with a gallery of the identical functions offered by jQuery, however this in turn does not work in IE, only in modern browsers like Firefox and Google Chrome.
A Brief Look
DOM Traversal and Manipulation
1 | $( "button.continue" ).html( "Next Step..." )
Event Handling
Show the #banner-message element that is hidden with display:none in its CSS when any button in #button-container is clicked.
1 | var hiddenBox = $( "#banner-message" );
2 | $( "#button-container button" ).click( function( event ) {
3 | hiddenBox.show();
4 | });
Ajax
Call a local script on the server /api/getWeather with the query parameter zipcode=97201 and replace the element #weather-temp's html with the returned text.
1 | $.ajax({
2 | url: "/api/getWeather",
3 | data: {
4 | zipcode: 97201
5 | },
6 | success: function( data ) {
7 | $( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" );
8 | }
9 | });