11 ], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
17 bind: function( types, data, fn ) {
18 return this.on( types, null, data, fn );
20 unbind: function( types, fn ) {
21 return this.off( types, null, fn );
24 delegate: function( selector, types, data, fn ) {
25 return this.on( types, selector, data, fn );
27 undelegate: function( selector, types, fn ) {
29 // ( namespace ) or ( selector, types [, fn] )
30 return arguments.length === 1 ?
31 this.off( selector, "**" ) :
32 this.off( types, selector || "**", fn );
36 // Bind a function to a context, optionally partially applying any
38 // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
39 // However, it is not slated for removal any time soon
40 jQuery.proxy = function( fn, context ) {
43 if ( typeof context === "string" ) {
49 // Quick check to determine if target is callable, in the spec
50 // this throws a TypeError, but we will just return undefined.
51 if ( !isFunction( fn ) ) {
56 args = slice.call( arguments, 2 );
58 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
61 // Set the guid of unique handler to the same of original handler, so it can be removed
62 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
67 jQuery.holdReady = function( hold ) {
74 jQuery.isArray = Array.isArray;
75 jQuery.parseJSON = JSON.parse;
76 jQuery.nodeName = nodeName;
77 jQuery.isFunction = isFunction;
78 jQuery.isWindow = isWindow;
79 jQuery.camelCase = camelCase;
82 jQuery.now = Date.now;
84 jQuery.isNumeric = function( obj ) {
86 // As of jQuery 3.0, isNumeric is limited to
87 // strings and numbers (primitives or objects)
88 // that can be coerced to finite numbers (gh-2662)
89 var type = jQuery.type( obj );
90 return ( type === "number" || type === "string" ) &&
92 // parseFloat NaNs numeric-cast false positives ("")
93 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
94 // subtraction forces infinities to NaN
95 !isNaN( obj - parseFloat( obj ) );