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

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: promise.fail(function(value){…}); $.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 , ,

Array

Remove Value from Array: https://css-tricks.com/snippets/jquery/remove-specific-value-from-array/

Posted in jQuery | Tagged ,

Check

Check if Element Exists: https://css-tricks.com/snippets/jquery/check-if-element-exists/ Check if Element is inside Another Specific Element: https://css-tricks.com/snippets/jquery/test-if-element-inside-element/

Posted in jQuery | Tagged ,