What are the hidden features of jQuery?
See also: Hidden features of javascript
What are the hidden features of jQuery?
See also: Hidden features of javascript
There is no built in "exists" function for JQuery.. but there should be (and can be)!
http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery
While the internal data() function is documented, its uses aren't. It's pretty general-purpose, as it allows you to see the data that jQuery has associated with any given elements.
For example, one such use is to see the actions that jQuery has bound to an element in its event registry, as in this answer.
Here is some good stuff:
http://james.padolsey.com/javascript/things-you-may-not-know-about-jquery/
You can set up data in a dialog component
Something like
$("#dialog").dialog({
"someData":"someData",
buttons:{
"Is there some data":function() {
alert($(this).dialog("option", "someData"));
}
}
});
Something I did not know until recently, you can select elements within another element in the DOM by passing a second parameter to the jQuery initializer
<div id="outer">
<div id="inner"> </div>
</div
the inner div is selected by
$('#outer').find('#inner')
//or shorter:
$('#inner', $('#outer'))
//or even shorter:
$('#inner', '#outer')
Also not at all hidden, but I didn't know until recently that enumerating over a jQuery object returns DOM objects. Therefore, if want to get at the underlying DOM object wrapped inside a jQuery array you just do $('#outer')[0]
jQuery's queue functions can be extremely useful.
Some example uses can be seen here: Can somebody explain jQuery queue to me?
That jQuery is JavaScript.
You can use any and all JavaScript with jQuery.