jQuery 工具函數

來源:互聯網
上載者:User

標籤:merge   not   方法   contents   oge   rem   而不是   length   sea   

jQuery.contains() : Check to see if a DOM element is a descendant of another DOM element.

僅僅支援文件項目

Note: The first argument must be a DOM element, not a jQuery object or plain JavaScript object.

jQuery.each() :  A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function‘s arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

jQuery.extend() : Merge the contents of two or more objects together into the first object.

第一個參數為ture時,執行深拷貝,target為第二個參數

jQuery.globalEval() : Execute some JavaScript code globally.

jQuery.grep() : Finds the elements of an array which satisfy a filter function. The original array is not affected.

類似於es5 的filter

jQuery.inArray() : Search for a specified value within an array and return its index (or -1 if not found).

jQuery.isArray() : returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object)

jQuery.isEmptyObject(): Check to see if an object is empty (contains no enumerable properties).

jQuery.isPlainObject() : Check to see if an object is a plain object (created using "{}" or "new Object").

jQuery.makeArray() : Convert an array-like object into a true JavaScript array.

jQuery.map() : Translate all items in an array or object to new array of items.

類似於es5 map方法 ,區別1)返回null時,值不被包含在結果中2)映射函數返回的如果是數組,則該數組被添加到結果數組中,而不是數組本身中

jQuery.merge() :  Merge the contents of two arrays together into the first array.

jQuery.parseJSON() : Takes a well-formed JSON string and returns the resulting JavaScript value.

jQuery.proxy() : Takes a function and returns a new one that will always have a particular context.

類似於es5的bind,但它沒有像bind()方法那樣實現參數的部分應用。

jQuery.trim() : Remove the whitespace from the beginning and end of a string.

If these whitespace characters occur in the middle of the string, they are preserved

jQuery 工具函數

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.