From b6f2cfa0d8ccbdd1c5490f3c6c80a8592709b5ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Note: This function has been deprecated and is now an alias for As described in the discussion for Consider a page with a simple list on it: The result of the following code is a red background behind items 3, 4 and 5: First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to Note: This API has been removed in jQuery 3.0; use The Note: This API has been removed in jQuery 3.0. The The value of this property is typically equal to Note that the context property may only apply to the elements originally selected by As of jQuery 1.7 this API has been deprecated; please use Note: This API has been removed in jQuery 1.8; please use Returns Note that a Deferred object can be in one of three states: pending, resolved, or rejected; use This API is Note: This API has been removed in jQuery 1.8; please use Returns Note that a Deferred object can be in one of three states: pending, resolved, or rejected; use Note: This API has been removed in jQuery 1.9; please use Any handler that has been attached with If used without an argument, .die() removes all event handlers previously attached using This method is a shortcut for As of jQuery 1.8, the Note: This API has been removed in jQuery 3.0; please use The For example, consider a page with a simple image element: Note: This API has been removed in jQuery 3.0; check if Note: This API has been removed in jQuery 1.9; please rely on feature detection instead. The Available flags are: Note: This API has been removed in jQuery 1.9; please rely on feature detection instead. Here are some typical results:
- This method is deprecated as of jQuery 1.7 and will be moved to a plugin in jQuery 1.8.
- Note: This API has been removed in jQuery 1.9. There are two specific use cases for which jQuery.sub() was created. The first was for providing a painless way of overriding jQuery methods without completely destroying the original methods and another was for helping to do encapsulation and basic namespacing for jQuery plugins. Note that jQuery.sub() doesn't attempt to do any sort of isolation - that's not its intention. All the methods on the sub'd version of jQuery will still point to the original jQuery (events bound and triggered will still be through the main jQuery, data will be bound to elements through the main jQuery, Ajax queries and events will run through the main jQuery, etc.). Note that if you're looking to use this for plugin development you should first strongly consider using something like the jQuery UI widget factory which manages both state and plugin sub-methods. Some examples of using the jQuery UI widget factory to build a plugin. As of jQuery 1.7, the Note: This API has been removed in jQuery 1.9; please use This method provides a means to attach delegated event handlers to the Rewriting the Note: This API has been removed in jQuery 3.0; please use This method is a shortcut for The For example, consider a page with a simple image: The Note: This API has been removed in jQuery 3.0. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as The Note: This method has been removed in jQuery 3.0. Use the The Given a simple unordered list on the page:.addBack()
, which should be used with jQuery 1.8 and later..end()
, jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf()
can help.
-
-<ul>
- <li>list item 1</li>
- <li>list item 2</li>
- <li class="third-item">list item 3</li>
- <li>list item 4</li>
- <li>list item 5</li>
-</ul>
-
-
-$( "li.third-item" ).nextAll().andSelf()
- .css( "background-color", "red" );
-
.nextAll()
then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf()
invocation merges these two sets together, creating a jQuery object that points to all three items in document order: [ <li.third-item>, <li>, <li> ]
..addBack()
instead, which should work identically..andSelf()
method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p")
. In the second example, .andSelf()
adds the previous set of elements on the stack — in this case $( "div.after-andself" )
— to the current set, selecting both the div and its enclosed paragraphs.
-
jQuery()
; if none was passed then context will likely be the document..context
property was deprecated in jQuery 1.10 and is only maintained to the extent needed for supporting .live()
in the jQuery Migrate plugin. It may be removed without notice in a future version..live()
method for binding event handlers uses this property to determine the root element to use for its event delegation needs.document
, as this is the default context for jQuery objects if none is supplied. The context may differ if, for example, the object was created by searching within an <iframe>
or XML document.jQuery()
, as it is possible for the user to add elements to the collection via methods such as .add()
and these may have a different context.deferred.state()
instead.deferred.state()
instead.true
if the Deferred object is in the rejected state, meaning that either deferred.reject()
or deferred.rejectWith()
has been called for the object and the failCallbacks have been called (or are in the process of being called).deferred.isResolved()
to determine whether the Deferred object is in the resolved state. These methods are primarily useful for debugging, for example to determine whether a Deferred has already been resolved even though you are inside code that intended to reject it.deprecated
as of jQuery 1.7 and removed
as of jQuery 1.8; please use deferred.state()
instead.deferred.state()
instead.true
if the Deferred object is in the resolved state, meaning that either deferred.resolve()
or deferred.resolveWith()
has been called for the object and the doneCallbacks have been called (or are in the process of being called).deferred.isRejected()
to determine whether the Deferred object is in the rejected state. These methods are primarily useful for debugging, for example to determine whether a Deferred has already been resolved even though you are inside code that intended to reject it.on()
instead..live()
can be removed with .die()
. This method is analogous to calling .off()
with no arguments, which is used to remove all handlers attached with .on()
.
See the discussions of .live()
and .off()
for further details..live()
from the elements..on( "error", handler )
..error()
method is deprecated. Use .on( "error", handler )
to attach event handlers to the error
event instead..on( "error", handler )
instead of .error( handler )
and .trigger( "error" )
instead of .error()
.error
event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly.
diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml
index ac464850..b80abe29 100644
--- a/entries/jQuery.boxModel.xml
+++ b/entries/jQuery.boxModel.xml
@@ -4,8 +4,12 @@
.document.compatMode
is equal to "CSS1Compat"
instead. Or, even better - always specify a DOCTYPE and avoid using quirks mode which jQuery doesn't support.$.browser
property provides information about the web browser that is accessing the page, as reported by the browser itself. It contains flags for each of the four most prevalent browser classes (Internet Explorer, Mozilla, Webkit, and Opera) as well as version information.
@@ -56,6 +59,9 @@ $.browser.msie;
.live()
method is deprecated. Use .on()
to attach event handlers. Users of older versions of jQuery should use .delegate()
in preference to .live()
.on()
instead.document
element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on()
method for more information. .live()
method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:
diff --git a/entries/load-event.xml b/entries/load-event.xml
index e3739cb7..b9669cc6 100644
--- a/entries/load-event.xml
+++ b/entries/load-event.xml
@@ -20,6 +20,9 @@
.on( "load", handler )
instead of .load( handler )
and .trigger( "load" )
instead of .load()
..on( "load", handler )
.load
event is sent to an element when it and all sub-elements have been completely loaded. This event can be sent to any element associated with a URL: images, scripts, frames, iframes, and the window
object..selector
property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live()
in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as $.fn.foo = function( selector, options ) { /* plugin code goes here */ };
, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} );
with the "div.bar"
selector repeated as the first argument of .foo()
.$.fn.foo = function( selector, options ) { /* plugin code goes here */ };
, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} );
with the "div.bar"
selector repeated as the first argument of .foo()
..size()
method is deprecated as of jQuery 1.8. Use the .length
property instead..length
property instead..size()
method is functionally equivalent to the .length
property; however, the .length
property is preferred because it does not have the overhead of a function call.
- Note: This API has been removed in jQuery 3.0; please use .on( "unload", handler )
instead of .unload( handler )
and .trigger( "unload" )
instead of .unload()
.
This method is a shortcut for .on( "unload", handler )
.
The unload
event is sent to the window
element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload
event.