Category Archives: jQuery

jQuery codes

jQuery Reviewer

What is jQuery? It is a JS library with a motto – write less, do more. It simplifies various tasks by writing less code. What are the features of jQuery? DOM Manipulation Event Handling AJAX Support Animations Lightweight – about … Continue reading

Posted in jQuery | Leave a comment


Promises – uses same ajax call on multiple pages var promise = $.Deferred(); – create a new promise object promise.resolve(value); – calls the done callback: promise.done(function(value){ }); promise.reject(value); – calls the fail callback:{…}); $.when(promise1, promise2…) – takes any number … Continue reading

Posted in jQuery

jQuery Ajax

XMLHttpRequest: example ActiveX for IE5 and IE6: code XMLHttpRequest Object: Methods & Properties Call Ajax: $.ajax(url[, setting]) $(‘.confirmation’).on(‘click’, ‘button’, function() { $.ajax(‘url’, { success: function(response) { $(‘.ticket’).html(response).slideDown(); }, data: {“confNum”: 1234 / $(“.ticket”).data(“confNum”) }, error: function(request, errorType, errorMessage) { alert(“Error:” + errorType + “with … Continue reading

Posted in jQuery | Tagged , , , , ,

jQuery CSS Styling

.css(<attr>, <value>): css({prop: ‘value’}); $(this).css(‘background-color’, ‘#252b30’); $(this).css({‘background-color’: ‘#252b30′,’font-weight’: ‘bold’}); Add/Remove Class: addClass() & removeClass() ToggleClass: toggleClass() Animation: animate()

Posted in jQuery | Tagged , ,


Remove Value from Array:

Posted in jQuery | Tagged ,


Check if Element Exists: Check if Element is inside Another Specific Element:

Posted in jQuery | Tagged ,