Event
.delegate()
.clearQueue() // remove the pending functions of be run
.serialize() //creates a URL encoded text string by serializing form values.
.serializeArray().stopPropagation() // dont tell parents
.stopImmediatePropagation() // dont tell siblings
jqXHR object is the return of an AJAX function
.noConflict() // return the use of $
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
.bind() associate this context to an event
.on(click, function(e){
e.originalEvent //== "Human" // determine if was done by a "Human"
})
CDN
How to load jquery from CDN and locally in case of failure
<script>
window.jQuery || document.wirte(" <script src=".../jquery.js"> </scritp>");
</script>
Custom Selector
$.extend( $.exp[":"] , {
function_name : function (element){
return $(element).css("font_family") === "Arial";
}
});
$("div:function_name").click( function (){
alert("Find");
});
Custom Function
jQuery.fn.extend({
check: function() {
return this.each(function() {
this.checked = true;
});
},
uncheck: function() {
return this.each(function() {
this.checked = false;
});
}
});
// Use the newly created .check() method
$( "input[type='checkbox']" ).check();
Comentarios
Publicar un comentario