Jquery 1.4 official documentation Chinese Version

Source: Internet
Author: User
Tags javascript eval
Document directory
  • Index in the element: $ ("# More-Info "). index ("H3") New. the has () method (has document, commit) is equivalent to the has () filter in the selector. It obtains a jquery set and returns elements containing the specified selector. New. nextuntil (),. prevuntil (),. parentsuntil () method (. nextuntil () document ,. prevuntil () document ,. the new "until" method in the parentsuntil () document, commit) is similar. nextall (),. prevall (), and. parents (). The difference is that you can use a selector to stop element exploration.. Add (string, element) (. Add () file, commit) can specify the environment for the. Add () method. This function can be used to add and operate additional elements in a call chain (such as new elements returned in Ajax requests ).. Closest (filter, domelement) (. Closest () document, commit) you can set a domelement environment using the 2nd parameters of the closest method. Setting an environment for closest can improve the running speed of this method. This optimization also applies to live () Because closest () is called internally (). Commonly used tools (utilities) jquery. isemptyobject () (jquery. isemptyobject () document, commit) if the object does not have any attribute, this method returns true. The jquery. isemptyobject () method does not check the parameters. Therefore, make sure that the parameters are an object. Jquery. isplainobject () (jquery. isplainobject (), commit. isplainobject () returns true. If the object is of another type (such as new object () or basic type, false is returned. Jquery. contains () (jquery. contains () document, commit) if both parameters are DOM nodes and the second node is nested inside the first node, jquery. contains () returns true. Otherwise, false is returned. Jquery. Noop (jquery. Noop () document, commit) is an empty function that can be used when a function is required. Note: Noop indicates no operation .) Jquery. Unique () (jquery. Unique () document) in jquery 1.4, the elements returned by the jquery. Unique () method are sorted in the order they are on the page. Because jquery uses the jquery. Unique () method when creating a jquery set, the set returned by the jquery method is arranged in the order they appear on the page. Others (Miscellaneous) jquery. browser are centered on the browser engine (jquery. browser document, commit). For example, you can use jquery. browser. WebKit to detect whether the engine is WebKit. Improved processing of applets (commit 1, commit 2) jquery no longer tries to bind events or data to Java applets (binding events or data may cause errors ). Arguments is no longer used. in order to comply with the requirements of Caja, callee (COMMIT) also marks it as obsolete in the ecmascript 5 specification to be applied soon. We will use all arguments in the jquery core. callee's code is removed. Replace the Yui min (COMMIT) Chinese API documentation with closure compiler to allow you to download the latest internal reorganization of API documentation at Ajax House (http://www.ajaxa.cn) one of the key points in the development process of version 1.4 is to build a readable and understandable code library. In order to achieve this goal, we have established a series of coding standard guides. The following are some major changes: the old 'core. the JS file is divided into 'attribute. js', 'css. js', 'Data. js', 'manipulation. js', 'traversing. js', and 'queue. js '. the ready event is moved into 'core. js' (because it is one of the basic components of jquery ). Most of the core Code conforms to the new code specification. The logic of CSS and attributes is divided, and they are no longer intertwined. Testing programmers comment on jquery framework performance to define jquery. prototype function change function description several minutes teaches you how to extend jquery's JSON skills description describes the use and solution of jquery tool functions. During the release of jquery 1.4, the code base was rewritten internally. During the release of jquery 1.4, 207 functions were fixed. problem (in comparison, there are 97 fixes in version 1.3 ). In addition, the number of tests has increased from 1504 in jquery 1.3.2 to 1.4 in 3060. All tests passed in the main browser. (Safari 3.2, Safari 4, Firefox 2, Firefox 3, Firefox 3.5, ie 6, IE 7, IE 8, opera 10.10, and chrome) we try to minimize the trouble that jquery 1.4 may cause for large-scale upgrades-keep the signatures of all public functions unchanged. Even so, read the list below to ensure that you may cause problems with your application.. Add () is no longer a simple concatenation of results, the results will be mixed together, and then arranged according to their order in the page.. Clone (true) Copies events and data, not just events. Jquery. Data (ELEM) does not return an ID, instead it is replaced by the object cache of the element. Jquery () (without parameters) is no longer automatically converted to jquery (document. Pass. Val ("…") Obtaining an option or a checkbox value is no longer ambiguous (it will always be selected based on the value attribute, rather than the text value ). (COMMIT) jquery. browser. version will now return the engine version. Now it will be stricter on the imported JSON. If the JSON format is not correct, an error will be reported. If you need to evaluate JavaScript that does not conform to the strict JSON format, you must set the requested file type to plain text and then use eval () to evaluate the content. Parameter serialization follows the PHP/rails style by default. You can switch to the old serialization method through jquery. ajaxsettings. Traditional = true. You can also switch between individual requests. When jquery. Ajax is called, The jquery. classname in {traditional: true} is removed. Jquery. Extend (true ,...) No longer extends complex objects or arrays. (Todo) If a Ajax request does not specify datatype and the returned data type is "text/JavaScript", the response will be executed. Before, you must specify the ype explicitly. Setting the "ifmodified" attribute of an Ajax request takes etags into account. We have also compiled a backward compatible plug-in for changes that may cause problems in version 1.4. If a problem occurs after you upgrade to 1.4, you can introduce this plug-in after introducing the 1.4 version file. How to use this plug-in: The following test packages are used in the raw data and test page performance test: Attributes class Dom manipulation empty/remove function call profiling: 1.3.2 1.4. original data of the result (all data is 1.3.2. 1.4 ): number of function calls 547 3 760 3 500 200 896 399 23909 299 307 118 28955 100 28648 201 1662 593 558 Dom embedding 317 1079 624 1079 516 1155 829 436 332 196 194 243 HTML 169 46 281 78 313 78 234 63 134 43 42 91 27 CSS/attribute 703 370 1780 1250 1765 1250 1157 749 629 498 346 184 333 161 114 CSS 203 118 109 93 116 47 54 58 24 54 22 CSS class 553 138 1578 546 1515 501 1033 327 769 298 229 80 173 41 removal/clearing 3298 286 9030 2344 7921 1703 5282 1266 2898 303 1166 140 1034 122
Jquery 1.4 was released earlier this month. This version contains a lot of programming, testing, and documenting work. This official document summarizes the changes and functions added to jquery 1.4. Many common and popular methods have been rewritten, and the performance has been greatly improved. This article is an announcement from the Chinese version of jquery 1.4 official documentation. Jquery 1.4 was released in the middle of this month. To celebrate jquery's four-week birthday, the jquery team was honored to announce the latest major version of The jquery JavaScript library! We are proud that this version contains a lot of programming, testing, and documenting work. I would like to personally thank Brandon Aaron, Ben Alman, Louis-Rémi babe, Ariel flesler, Paul Irish, Robert Kati ?, Yehuda Katz, Dave methvin, Justin Meyer, Karl swedberg, and Aaron Quint. Thank you for fixing the bug and completing the work on this release. Downloading: By convention, we provide two copies of jquery, one of which is minimized (we now use Google closure as the default compression tool ), one copy is uncompressed (for error correction or reading ). Jquery compression (23kb gzipped) http://code.jquery.com/jquery-1.4.min.js jquery regular (154kb) http://code.jquery.com/jquery-1.4.js In addition, Google also placed a copy of jquery on their server. This copy will be automatically minimized and then compressed-and stored on Google's fastest cache server. Http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js you can directly reference the above URL on your site, so you can enjoy the performance advantage of quickly loading jquery. For jquery1.4, we strive to reduce the trouble of large-scale upgrades-by keeping the signatures of all public functions. Even so, read through the list of changes that may cause problems, so that you can understand which changes may cause problems for your application. (Function) the following content of features summarizes the changes and functions added in jquery1.4. In addition, all the changes have been recorded in the document of jquery 1.4. Popular methods have undergone major performance overhaul. Many popular and commonly used jquery methods have been rewritten in 1.4. When we analyze the source code, we find that we can achieve a significant performance improvement by comparing jquery with ourselves: check the number of calls to internal functions and try to reduce the complexity of the source code. in the 1.4 version, we significantly reduced the complexity of most popular jquery methods. Easy setter functions has been around for a while. ATTR () transmits a function, and then the result of this function is assigned to the corresponding HTML attribute. This function is now ported to all the setting functions :. CSS (),. ATTR (),. val (),. HTML (),. text (),. append (),. prepend (),. before (),. after (),. replacewith (),. wrap (),. wrapinner (),. offset (),. addclass (),. removeclass (), and. toggleclass (). in addition, for the following methods, the current value will be passed to this function as 2nd variables .. CSS (),. ATTR (),. val (),. HTML (),. text (),. append (),. prepend (),. offset (),. addclass (),. removeclass (), and. toggleclass (). in this way, the code can be written as follows: // find the '&' characters in all the tags, and then use a span tag to enclose functions ('a'{.html (function (I, HTML) {return HTML. replace (// GI, '&') ;}); // Add some information to the title attribute of some links $ ('a [target] '). ATTR ("title", function (I, Title) {return title + "(new window open)" ;}); serialization of Ajax nested parameters (jquery. param () documentation, commit 1, commit 2) jquery 1.4 in jqu The ery. Param method is added with support for Embedded parameter serialization. It borrowed from the rise of PHP programming and was then promoted by Ruby on Rails. For example, {FOO: ["bar", "Baz"]} is serialized as "foo [] = Bar & Foo [] = Baz ". in jquery 1.3, {FOO: ["bar", "Baz"]} was serialized as "foo = Bar & Foo = Baz ". however, there is no way to encode the array containing only one element. If you need the old serialization method, you can set the traditional Ajax settings to switch. (Use jquery. ajaxsettings. Traditional to perform a global switch, or independently switch as needed. There are three ways to switch to the old serialization method: // globally change the serialization method (using the old one) jquery. ajaxsettings. traditional = true; // specify the old serialization method jquery. param (stuff, true); // use the old serialization Method for a separate Ajax request $. ajax ({data: stuff, traditional: true}); For more information, see jquery. param () document, jquery. ajax () documents, commit, code JSON and script types are automatically identified by "Content-Type. (Jquery. ajax document, commit 1, commit 2) if the media type of an Ajax request response is JSON (Application/JSON ), datatype is set to "JSON" by default (if datatype is not specified ). In addition, if the reply media type is JavaScript (Application/JavaScript), datatype is set to "script" by default (Similarly, if datatype is not explicitly specified). In this case, the script runs automatically. Added the etag support (jquery. Ajax () document, commit). By default, jquery ignores the "Last-modified" page header of the Ajax request. This is done to ignore the browser cache. If ifmodified is set to true, jquery can use the available cache. Jquery1.4 will also issue the "if-None-match" page header if you have set the ifmodified option. Strict JSON mode, local JSON. parse method (jquery. ajax () documentation, commit 1, commit 2, commit 3) jquery 1.3 and earlier versions used Javascript eval to parse the introduced JSON. Version 1.4 Uses a local JSON parser, provided that a local parser is available. It also verifies the imported JSON. Therefore, in the jquery. getjson method, or when the datatype of an Ajax request is "JSON", jquery rejects non-standard JSON (for example, {FOO: "bar "}). Serialize HTML5 elements (jquery. param () document, commit) The new HTML5 input methods (such as 'datetime' and 'range') in serialization. serialize () is included in a form. Ajax request environment (jquery. ajax () documentation, commit) You can append an "environment" to an Ajax request, and all callback functions will have the same "environment" Settings (this can simplify your code, avoid using closed objects or other objects ). Jquery. ajax ({URL: "test.html", Context: document. body, success: function () {jquery (this ). addclass ("done") ;}}); the third parameter of the callback function for successful requests will be set to the original xhr object (jquery. the success callback function of all Ajax requests in the Ajax () documentation, commit) will now receive the original XMLHTTPRequest object as the third parameter. Previously, this xhr object can only be obtained through the return values of the $. Ajax method. Explicitly set "Content-Type" (jquery. Ajax () document, commit) in version 1.3. If no actual data is sent, the contenttype of jquery. Ajax will be ignored. In version 1.4, contenttype will always be sent together with the request. This fixes some problems caused by determining the reply category based on the "Content-Type" page header in the background. Specify the name of the jsonp callback function (jquery. Ajax document, commit). You can use the jsonpcallback option of the jquery. Ajax () method to specify the callback function of jsonp by name. Prevent cross-origin xhr (COMMIT) Cross-origin Ajax before startup (for supported browsers) from being easier to use, because xhr is blocked by default. (Todo) jquery. ajax () now uses the onreadystatechange event to replace the timer (COMMIT) with the onreadystatechange event to replace the round-robin query. Ajax requests now use fewer resource element attributes (attributes ). CSS () and. the performance of ATTR () is optimized. '). ATTR ("Alt", function (index, value) {return "please," + value;});. Val (function) (. Val () Document) Jquery ("input: Text. Food"). Hide (); jquery ("
  • Peanut butter
  • Jelly

"). Sortable (). BIND ("endsort", function () {$ (": text. food "). val (function () {return $ ("ul. sortable Li: eq ("+ $ (this ). ATTR ("data-index") + ")"). text () ;}); text and cdatahtml elements are also supported. text () method (. text () document, commit) core (CORE) Quick element creation (jquery () document, commit) now when you need to use the jquery function to create an element, you can attach an object to specify the property value and event: jquery ("", {ID: "foo", CSS: {Height: "50px", width: "50px ", color: "blue", backgroundcolor: "# CCC" }, Click: function () {callback (this).css ("backgroundcolor", "Red ");}}). appendto ("body"); the name of the key value in the object corresponds to the name of the relevant jquery method, and the value of the object is passed to the jquery method as a parameter. (For example, $ ("Link", {CSS: {Background: "# CCC"}); equivalent to $ ("Link" without permission .css ("background ", "# CCC ");. eq (-N ),. get (-N) (negative index )(. eq () documentation ,. get () document, commit) You can now go. get () and. negative values are used in the eq () method. For example, you need to select the last 2nd DIV elements or the last 2nd DOM objects: $ ("Div "). eq (-2); $ ("Div "). get (-2); New. first () and. last () method (. first () document ,. last () document, commit) is added for convenience. first () and. the last () method is equivalent. eq (0) and. eq (-1 ). new. toarray () method (. toarray () document, commit ). the get () method returns an array from the jquery set. To be clearer, you can use. toarray () to achieve the same effect. (Note: this should be used to set aside space for future versions. For example, the. tolist () method may be added in the future, which will be easy to differentiate .) However, unlike. Get (),. toarray () does not accept parameters. Jquery () returns an empty set (jquery () document, commit). In jquery 1.3, the jquery () method returns jquery sets that only contain documents. This can be used to create an empty set and then dynamically add some elements. Note: The jquery (). Ready () method is still valid in 1.4, but is indicated to be obsolete. Use jquery (document). Ready () or jquery (function (){}). Jquery ("tag") (element selector document, commit) uses a quicker path when using a single tag name. Jquery (""), jquery ("

") And jquery ("

") (Jquery () documentation, commit) now all three methods use the same code path (document. createelement) to optimize jquery ("

. Note: If you specify attributes, you will use the syntax analysis of the browser (by setting innerhtml ). The style (CSS). CSS () method has twice the performance of the previous one. . Addclass (),. removeclass (), and. hasclass () has three times the performance of the previous methods. toggleclass () can switch multiple CSS classes (. toggleclass () document, commit) you can use. toggleclass () calls the names of multiple CSS classes to switch between them. $ ("Div "). toggleclass ("current active"); data. data () returned object ,. data (object) sets the object (. data () documentation, commit 1, commit 2) Sometimes you may need to attach a complex object to an element. A common example is that you need to copy all the data from an element to an element. In jquery 1.4, when. Data () is called without any parameters,. Data returns a complex object. The object that contains all key-value pairs .) Call. Data (object) to set this object. Note that this object also includes events bound to elements, so be careful when using it. No data cache is created unless necessary. (Commit 1, commit 2, commit 3) jquery uses a unique custom attribute to obtain additional data on a specific element. When you search for data but no newly added data, jquery tries its best to avoid creating this custom attribute. This may improve performance and avoid Dom contamination. Effect (effects) A single attribute is slow (Per-property easing document, commit). In addition to specifying a slow function for a dynamic effect, you can now specify the slow-forward function for each attribute. James padolsey's blog provides further information and demos. $ ("# Clickme "). click (function () {$ ("Div "). animate ({width: ["+ = 200px", "Swing"], height: ["+ = 50px", "linear"] ,}, 2000, function () {$ (this ). after ("animation complete.

") ;}); New Method of event (events): jquery. proxy () (jquery. proxy () encryption enation, commit 1, commit 2) If you need to ensure that the "This" in a function keeps a value constant, you can use jquery. proxy obtains a function with the same scope. VaR OBJ = {name: "John", test: function () {alert (this. name); $ ("# test "). unbind ("click", obj. test) ;}}; $ ("# test "). click (jquery. proxy (OBJ, "test"); bind multiple events (. BIND () Document) You can bind multiple events of an element at a time by handing in an object. $ ("Div. test "). BIND ({Click: function () {$ (this ). addclass ("active") ;}, mouseenter: function () {$ (this ). addclass ("Inside") ;}, mouseleave: function () {$ (this ). removeclass ("Inside") ;}}); 'change' and 'submit 'event normalization (Change document, submit document) normal or instant change and submit events can work stably on various browsers. We replaced change and submit in IE with the same events as other browsers. New events: 'focusin' and 'focusout '(. focusin () document ,. focusout () document, commit) focusin and focusout are generally the same as focus and blur, but they are more useful for passing to the parent element. If you write your own event proxy mode (Todo), this function will be of great help to you. Note that using the live () method for focus and blur does not work. During design, we decided not to pass events to the parent element based on DOM Event specifications. $ ("Form"). focusout (function (event) {var TGT = event.tar get; If (TGT. nodename = "input "&&! TGT. value) {$ (TGT ). after ("nothing here") ;}}); all events can become real-time events (. live () Documentation) except ready, focus (with focusin), and blur (with focusout), all can be used. events bound to bind () can all be real-time events. In the events supported by live (), we are particularly proud to be able to support the following additional events. Through event proxy in. Live (), version 1.4 provides cross-browser support for change, submit, focusin, focusout, mouseenter, and mouseleave events. Note: If you need instant focus events, you should use focusin and focusout instead of focus and blur, because as mentioned above, focus and blur are not passed up. Also, live () accepts data objects as parameters. Like the BIND () method (COMMIT), live/die also supports environment variables (COMMIT) now you can specify an environment for the selector when binding events. If the environment is specified, only elements in the environment are bound to events. When creating an instant event, the element itself does not need to be defined, but the environment must be created. Determine that the ready event contains at least the body element (COMMIT). jquery will now check whether the body exists. If it does not exist, it will take turns to inquire the body. In non-ie browsers that do not need to manually handle memory overflow, The unmount speed is improved. (COMMIT) the performance of a series of Dom operation methods in jquery 1.4 has been greatly improved.. Append (),. prepend (),. Before (), and. After () improves performance. The performance of. html () is increased to three times that of the previous one.. Remove () and. empty () is four times faster than before. new Method :. detach ()(. the detach () document, commit) detach () removes an element from the Dom, but does not uninstall the associated event handler. This method can be used to temporarily remove an element, perform related operations, and then return. VaR Foo = $ ("# foo "). click (function () {// related operation}); Foo. detach (); // Foo retains the related handler Foo. appendto ("body"); the new unwrap () method (documentation, commit) unwrap () method obtains the child element of a known parent element, then replace the parent element with a child element. The child element is taken out of the package because it is named unwrap ). In this case:

Annie

Davey

Stevie

$ ('Div '). Unwrap ();

Annie

Davey

Stevie

The cache (COMMIT) jquery in the dommanip method records the nodes created by jquery ("") and. After ("") Methods to the cache. In this way, the performance of pages that use strings for Dom operations will be greatly improved. Before, after, and replacewith operations (COMMIT) between unconnected nodes now allow you to perform before, after, and replacewith operations on nodes not placed on the DOM tree. This means that you can perform complex operations on the nodes first, and then place them in the appropriate Dom location. In this way, try to avoid re-layout during the operation. Jquery (""). Before ("

Hello

"). Appendto ("body "). clone (true) also copies the associated data (clone document, commit) in version 1.3 ,. although clone (true) is also a deep copy, it does not copy the associated data. In version 1.4, it copies data and includes all events. This is the same as jquery. Extend in semantics. Therefore, normal objects and arrays will be copied, but custom objects will not. Offset. offset (coords | function) (. offset (), commit) Now you can set the element displacement! Like all the setting functions, offset can take a function as the second parameter. After a queue (queueing) queue has undergone an overhaul, it is easier to use the queue than to use the default FX. The new. Delay () method (. Delay () document, commit). Delay () method will lag the remaining objects in the execution queue several milliseconds according to the parameter. By default, it uses the "FX" queue. However, you can select another queue using the second parameter of the delay method. Each queue is identified by a name .) $ ("Div "). fadein (). delay( 4000 ). fadeout (); next (. in the queue () document, commit) jquery 1.4, when a function in the queue is called, the first parameter is set as another function. When the latter is called, The next object in the queue is automatically excluded to push the queue to the next step. Jquery ("Div "). queue ("ajax", function (next) {var self = This; jquery. getjson ("/update", function (JSON) {response (self).html (JSON. text); next ();};}). queue ("ajax", function () {$ (this ). fadein ();});. the clearqueue () (clearqueue document, commit) queue can be cleared. This method removes all unexecuted functions in the queue, but does not remove the running functions. If no parameter is specified, the default "FX" queue is cleared when the. clearqueue () method is called. Selectors "# id p" is more efficient (COMMIT). All the delimiters starting with ID have been optimized, so they can return values instantly. All the delimiters starting with ID are faster than other delimiters. The page traversal (traversing). Index (),. Index (string) (index document, commit). Index () method is rewritten to become more intuitive and flexible. You can obtain the index of an element relative to the same parent element: // calculate the first element.

  • Index of an element in all its parent elements: $ ("Li. current "). index () You can also obtain the index of an element in a jquery element set. This set can be specified by an selector or DOM element: // calculate this
    All elements on the page
    Index in the element: $ ("# More-Info "). index ("H3") New. the has () method (has document, commit) is equivalent to the has () filter in the selector. It obtains a jquery set and returns elements containing the specified selector. New. nextuntil (),. prevuntil (),. parentsuntil () method (. nextuntil () document ,. prevuntil () document ,. the new "until" method in the parentsuntil () document, commit) is similar. nextall (),. prevall (), and. parents (). The difference is that you can use a selector to stop element exploration.. Add (string, element) (. Add () file, commit) can specify the environment for the. Add () method. This function can be used to add and operate additional elements in a call chain (such as new elements returned in Ajax requests ).. Closest (filter, domelement) (. Closest () document, commit) you can set a domelement environment using the 2nd parameters of the closest method. Setting an environment for closest can improve the running speed of this method. This optimization also applies to live () Because closest () is called internally (). Commonly used tools (utilities) jquery. isemptyobject () (jquery. isemptyobject () document, commit) if the object does not have any attribute, this method returns true. The jquery. isemptyobject () method does not check the parameters. Therefore, make sure that the parameters are an object. Jquery. isplainobject () (jquery. isplainobject (), commit. isplainobject () returns true. If the object is of another type (such as new object () or basic type, false is returned. Jquery. contains () (jquery. contains () document, commit) if both parameters are DOM nodes and the second node is nested inside the first node, jquery. contains () returns true. Otherwise, false is returned. Jquery. Noop (jquery. Noop () document, commit) is an empty function that can be used when a function is required. Note: Noop indicates no operation .) Jquery. Unique () (jquery. Unique () document) in jquery 1.4, the elements returned by the jquery. Unique () method are sorted in the order they are on the page. Because jquery uses the jquery. Unique () method when creating a jquery set, the set returned by the jquery method is arranged in the order they appear on the page. Others (Miscellaneous) jquery. browser are centered on the browser engine (jquery. browser document, commit). For example, you can use jquery. browser. WebKit to detect whether the engine is WebKit. Improved processing of applets (commit 1, commit 2) jquery no longer tries to bind events or data to Java applets (binding events or data may cause errors ). Arguments is no longer used. in order to comply with the requirements of Caja, callee (COMMIT) also marks it as obsolete in the ecmascript 5 specification to be applied soon. We will use all arguments in the jquery core. callee's code is removed. Replace the Yui min (COMMIT) Chinese API documentation with closure compiler to allow you to download the latest internal reorganization of API documentation at Ajax House (http://www.ajaxa.cn) one of the key points in the development process of version 1.4 is to build a readable and understandable code library. In order to achieve this goal, we have established a series of coding standard guides. The following are some major changes: the old 'core. the JS file is divided into 'attribute. js', 'css. js', 'Data. js', 'manipulation. js', 'traversing. js', and 'queue. js '. the ready event is moved into 'core. js' (because it is one of the basic components of jquery ). Most of the core Code conforms to the new code specification. The logic of CSS and attributes is divided, and they are no longer intertwined. Testing programmers comment on jquery framework performance to define jquery. prototype function change function description several minutes teaches you how to extend jquery's JSON skills description describes the use and solution of jquery tool functions. During the release of jquery 1.4, the code base was rewritten internally. During the release of jquery 1.4, 207 functions were fixed. problem (in comparison, there are 97 fixes in version 1.3 ). In addition, the number of tests has increased from 1504 in jquery 1.3.2 to 1.4 in 3060. All tests passed in the main browser. (Safari 3.2, Safari 4, Firefox 2, Firefox 3, Firefox 3.5, ie 6, IE 7, IE 8, opera 10.10, and chrome) we try to minimize the trouble that jquery 1.4 may cause for large-scale upgrades-keep the signatures of all public functions unchanged. Even so, read the list below to ensure that you may cause problems with your application.. Add () is no longer a simple concatenation of results, the results will be mixed together, and then arranged according to their order in the page.. Clone (true) Copies events and data, not just events. Jquery. Data (ELEM) does not return an ID, instead it is replaced by the object cache of the element. Jquery () (without parameters) is no longer automatically converted to jquery (document. Pass. Val ("…") Obtaining an option or a checkbox value is no longer ambiguous (it will always be selected based on the value attribute, rather than the text value ). (COMMIT) jquery. browser. version will now return the engine version. Now it will be stricter on the imported JSON. If the JSON format is not correct, an error will be reported. If you need to evaluate JavaScript that does not conform to the strict JSON format, you must set the requested file type to plain text and then use eval () to evaluate the content. Parameter serialization follows the PHP/rails style by default. You can switch to the old serialization method through jquery. ajaxsettings. Traditional = true. You can also switch between individual requests. When jquery. Ajax is called, The jquery. classname in {traditional: true} is removed. Jquery. Extend (true ,...) No longer extends complex objects or arrays. (Todo) If a Ajax request does not specify datatype and the returned data type is "text/JavaScript", the response will be executed. Before, you must specify the ype explicitly. Setting the "ifmodified" attribute of an Ajax request takes etags into account. We have also compiled a backward compatible plug-in for changes that may cause problems in version 1.4. If a problem occurs after you upgrade to 1.4, you can introduce this plug-in after introducing the 1.4 version file. How to use this plug-in: The following test packages are used in the raw data and test page performance test: Attributes class Dom manipulation empty/remove function call profiling: 1.3.2 1.4. original data of the result (all data is 1.3.2. 1.4 ): number of function calls 547 3 760 3 500 200 896 399 23909 299 307 118 28955 100 28648 201 1662 593 558 Dom embedding 317 1079 624 1079 516 1155 829 436 332 196 194 243 HTML 169 46 281 78 313 78 234 63 134 43 42 91 27 CSS/attribute 703 370 1780 1250 1765 1250 1157 749 629 498 346 184 333 161 114 CSS 203 118 109 93 116 47 54 58 24 54 22 CSS class 553 138 1578 546 1515 501 1033 327 769 298 229 80 173 41 removal/clearing 3298 286 9030 2344 7921 1703 5282 1266 2898 303 1166 140 1034 122
  • Posted @ 2010-03-24 shuimu read (...) Comments (...) EDIT favorites

    Refresh comment refresh page Back to Top

    Blog homepage blog news flash programmer recruitment Knowledge Base

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.