jquery array of objects

2010-07-10  来源:本站原创  分类:Web  人气:261 

We all know jQUery object has a class element of the array packing set, the collection as such has a js array length property, we call this class of arrays, we have to sum up the following under the jQuery object to an array of classes operate, and look at our jQuery to provide what we all methods available:

size (): Obviously, it should focus on the number of elements to return packaging, such as the $ ('a'). size () that links the number of elements;

get (index): if not specified the default index when taken together all elements of packaging and to js array in the form of return, if the specified index, it returns the corresponding subscript for the index elements, such as $ ('img [title] '). get (0) contains the property title back to the first img element, its is also equivalent to the $ (' img [title] ') [0];

index (elem): elem element returned in the packaging where the subscript, if the element is not found returns -1;

add (String | elem | Array): the parameters of the elements added to the package focus, if the parameter is the jQuery selector, then all the matching objects will add to the collection, if it is the html element method obtained by clean array elements add to the collection, if it is dom dom element or element of the array, then added directly to the collection of; note is added after the return of the packaging assembly; such as $ ('img [alt]', 'img [title]' ) is equivalent to $ ('img [alt]'). add ('img [title]') that is returned contains the alt attribute of the img element, or contains a title attribute of img elements;

not (String | elem | Array): the package focus on the elements to meet the parameters removed, attention can only filter parameter expression, that is, "[" or ":" at the beginning of the expression, such as $ ('img [title] '). not (' title *= puy ') that is returned contains the title attribute of the img element, and these elements of the title attribute contains text puy; returns after the package selection set;

filter (String | function): If the incoming parameter is a String type, then the expression must also be screening an expression for the episode removed from the packaging does not match all the elements of choice; is a function if the incoming , then the concentration of each element package are calling this function, this function returns false if it put the focus on the element removed from the packaging, and in the function called by this keyword to call a method when packing concentration of the element; such as $ ( 'td'). filter (function () (return this.innerHTML.match (/ ^ "d +$/)}) td content to return all the td elements to numbers;

slice (begin, end): Creates and returns a new package set, the package set is the original packaging of the continuous part, and new packaging sets the first element is the location of the original packaging concentrated elements begin, and the last element is elements of the previous end position element, of course, can not specify the end, it will extend to the end of the original package set; as $('*'). slice (2,3) This statement is select all the elements on the page, and then survive include The third set of original packaging element of the new package set, pay attention to this $('*'). get (2) different, this returns the element, and slice method returns the packaged set, which has a packaging assembly operations;

childen (): returns all elements of the original packing set is composed of different sub-elements of the new package set (does not include text nodes), such as $ ('div'). children () returns all child elements of div elements formed under the new Package set; If you specify a parameter, then the argument is an expression screening;

contents (): returns the contents of the original packaging sets new packaging element set (can contain text nodes); Note that this method can not accept the parameters of filter;

next (): returns all elements of the original package set only next sibling element of the set consisting of new packaging; If you specify a parameter, then the argument is an expression screening; such as $ ('div # someDiv'). next ( ) Returns id of the div element for the someDiv next brother element of the package set; If you specify a parameter, then the argument is an expression screening;

nextAll (): Returns a set of elements in the original packaging for all new package sets up brother; such as $ ('div # someDiv'). nextAll () Returns id of the div element for the someDiv brothers behind the elements of the new package set; if specified parameters, then the argument is an expression screening;

parent (): returns the original packaging has all the elements of the only direct parent element of the new packing set; If you specify a parameter, then the argument is an expression screening;

parents (): returns the original packaging has all the elements of the ancestor elements of the new package set; If you specify a parameter, then the argument is an expression screening;

prev (): return to original packing set elements only a brother to all elements of the new packing set; if the specified parameters, then the argument is an expression screening;

prevAll (): Returns a set of elements in the original packaging of all elements of the new packaging in front of brothers set; If you specify a parameter, then the argument is an expression screening;

siblings (): Returns a set of elements in the original packaging, the only brother of all elements of the set consisting of new packaging; If you specify a parameter, then the argument is an expression screening;

find (String): Returns a set in the original packaging with the incoming selector expression that matches the set of all elements of the new packaging, and the concentration of elements in the original packaging for future generations will also be introduced new packaging set;

contains (text): return parameter contains the text elements of the incoming text string consisting of the new package set;

is (String): String matching if the packaging contains the elements of focus, then return true, otherwise return false;

clone (copyHandle): If the incoming parameter is true, then the event will be accompanied with the copy, or do not copy the event to form a new packing set;

end (): jQuery command chain in the call to return to retreat before a packed set;

andSelf (): Merge command chain, recently created two package set;

相关文章
  • jquery array of objects 2010-07-10

    We all know jQUery object has a class element of the array packing set, the collection as such has a js array length property, we call this class of arrays, we have to sum up the following under the jQuery object to an array of classes operate, and l

  • Detailed jQuery array processing 2011-01-11

    jQuery array processing, convenient, fully functional. most recent project used in the more deeply practical, step in place encapsulates many of the original raw js array can not match the function. Recently pressed for time today, some time back to

  • Passing array of objects using axis2 2010-07-13

    Write a simple say hello webservice example. The object is passed string, and only one method; but the actual application, the need to pass some of the copied object, such as: arrays, collections, an array of objects. As the webservice to interact th

  • [Turn] to deal with the oracle in java array of objects (nested tables) 2011-08-30

    To deal with the oracle in java array of objects (nested table): sp file: ------------------------------- Create Object Type ---------------- ------------------ create or replace type o_tmp as object ( userid varchar2 (10), username varchar2 (20) );

  • [Transfer] jquery array of filters in the filter - $. Grep () 2010-09-28

    Reprinted from: Terminal written by the fool http://www.css88.com/archives/2472 jquery There is a grep () method is used to filter filter array elements, the tragedy is that, usually we use the api can not find the description of the document. View t

  • oracle stored procedure returns an array of objects method 2010-03-29

    ① stored procedure returns an array of type CREATE OR REPLACE TYPE SCOTT.EMP_LINE AS OBJECT ( EMPNO NUMBER (4)    , ENAME VARCHAR2(20) ); CREATE OR REPLACE TYPE SCOTT.EMP_ARRAY AS TABLE OF EMP_LINE; ② jdbc wording of the definition of a class SQLData

  • webservice returns an array of objects 2010-04-10

    First, the establishment of ServiceTest.java Java code package sample.ws.service; import sample.ws.pojo.Person; public class ServiceTest ( / ** * Is very simple we just will be sent over the person [] to return to the * @ Param person * @ Return * /

  • java sort array of objects 2010-03-24

    import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Test { public static void main(String[] args) { Employee[] staff = new Employee[5]; staff[0] = new Employee("Harry Hacker", 35000); staff[1] = new Employee(

  • List array of objects into a collection of objects 2010-07-17

    package com.cn.tool; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ArrayToList { /** * Array into List( Do not recommend the use of ) * @param o Array object * @return The converted collection object */ publ

  • Ruby array of objects to add a different sort of different ways 2010-07-23

    Sometimes we need to add the class an example of the object as follows: class Person end pedro = Person.new peter = Person.new # inject a method in the instances def pedro.hello_world; puts "Hola Mundo"; end def peter.hello_world; puts "Hel

  • Multi-dimensional array of objects transferred 2011-01-12

    static function object_to_array($data) { if(is_object($data)) { $data = (array)$data; if(is_array($data)) { foreach($data as $key=>$value) { $data[$key] = self::object_to_array($value); } } } return $data; }

  • javascript remove element Array built-in objects 2011-05-30

    In the javascript in, Array object does not provide delete method to delete the array, and some people will say there is a js in their own way to delete an array element delete, delete but you did not change after the length of the array, this is not

  • Obtained through the NAME attribute similar to TD function of an array of objects 2010-04-04

    function $ Attr (sattribute, svalue, stagname, obody) ( var r_eles = []; obody =!! obody? obody: document.body; / / limits and look for this container var objs = obody.getElementsByTagName (stagname); for (var pos = 0, s = [], len = objs.length; pos

  • Jquery iterate json and array 2010-06-22

    01. <! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 02. <html Xmlns="http://www.w3.org/1999/xhtml"> 03. <head> 04. <meta

  • javascript array of Array objects 2010-04-23

    new Array () new Array (len) new Array ([item0, [item1, [item2 ,...]]] Method using an array of objects: var objArray = new Array (); objArray.concact ([item1 [, item2 [,....]]]------------------- objArray the parameter list to connect to the back of

  • JS Array "(array) and the" objects "(object) 2010-08-24

    JS Array "(array) and the" objects "(object) JS Technology 2009-12-30 16:15:45 read 294 comments 0 font size: large, medium Subscribe For example there is an array a = [1,2,3,4], there is an object a = (0:1,1:2,2:3,3:4), and then you run th

  • jQuery objects and DOM objects [jQuery Development Note point (a)] 2010-12-23

    Reprinted: jQuery objects and DOM objects point [jQuery Development Note (a)] http://www.blogjava.net/jy00314996/archive/2009/02/17/255083.html Learning jQuery has been 3 days, summed up the local supply of some attention for beginners like me jQuery

  • JQuery tutorial basic common method 2009-06-02

    $ ( "P"). AddClass (css style defined type); to add an element of style $ ( "Img"). Attr ((src: "test.jpg", alt: "test Image")); to add an element property / value parameter is the map $ ( "Img"). Attr ( &

  • Guinness JQuery method 2009-09-17

    Dom: Attribute: $ ( "p"). addClass (css style defined type); to add an element of style $ ( "img"). attr ((src: "test.jpg", alt: "test Image")); to add an element attribute / value parameter is the map $ ( "img

  • JSON - Java and AJAX (Jquery) 2010-03-29

    1, JSON What is this? JSON stands for JavaScript Object Notation, is a lightweight data interchange format. JSON and XML with the same characteristics, such as easy-to-person writing and reading, easy-to-machine generation and parsing. However, more