Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
58 Cards in this Set
- Front
- Back
Purpose of $.support
|
Provides flags for various functions to replace browser sniffing and ensure cross-browser functionality.
|
|
Dose $.support.boxModel return true for IE?
|
In quirksmode it returns false, in standards mode it returns true.
|
|
define $.support.boxModel
|
Set to true if user agent renders according to standards compliant box model.
|
|
when is $.support.boxModel defined?
|
on document ready
|
|
define $.support.cssFloat
|
true if cssFloat of elements style property is used by current browser
|
|
define $.support.hrefNormalized
|
true if obtaining href element attributes returns the value exactly as specified
|
|
define $.support.htmlSerialize
|
true if browser evaluates style sheets referenced by <link> elements when injected into the DOM via innerHTML
|
|
define $.support.leadingWhitespace
|
true if browser honors leading whitespace when text is inserted via innerHTML
|
|
define $.support.noCloneEvent
|
true if browser does not copy event handlers when event is cloned
|
|
define $.support.objectAll
|
true if getElementsByTagName() method returns all descendants when passed "*"
|
|
define $.support.opacity
|
true if browser correctly interprets standard CSS opacity property
|
|
define $.support.scriptEval
|
true if browser evaluates <script> blocks when they're injected via calls to appendChild() or createTextNode() methods
|
|
define $.support.style
|
true if the attribute for obtaining the inline style properties of an element is style
|
|
define $.support.tbody
|
true if browser doesn't automatically insert <tbody> elements into tables lacking them when injected via innerHTML
|
|
list browsers for which all $.support variables return true
|
All except for Internet Explorer, which always returns false for everything except boxModel
|
|
purpose of $.browser object
|
detects user agent types and sets flags for browser detection (DEPRECATED FUNCTION)
|
|
list the flags set on $.browser
|
msie - Internet Explorer
mozilla - Firefox and Camino (mozilla based) safari - Safari, Chrome, OmniWeb (web-kit based) opera - Opera version - number of rendering engine for browser |
|
(true or false) $.browser.version is the version of the browser, such as IE 5.5
|
false - it's the version of the rendering engine (which happens to be the same as the browser version in IE only)
|
|
(true or false) $.browser.version represent the browser version for IE
|
true - $.browser.version is the rendering engine number; however, in IE the rendering engine and browser have the same version number
|
|
define $.noConflict(boolean)
|
Restores control of $ identifier back to another library (such as Prototype), allowing multiple libraries on a single page.
If the boolean is set to true, then jQuery identifier is relinquished, too |
|
when using multiple libraries, at what point in loading scripts should $.noConflict() be called?
|
After including jQuery but before including the conflicting library
|
|
What is an instance where browser sniffing (using $.browser) would be appropriate, instead of feature detection (using $.support)?
|
When the attributes passed to a method are different, based on the browser, so there is no way to differentiate using feature detection, such as the following example:
element.add(element, below) for <select> elements "below" is an object reference for standards compliant browsers, but an integer for IE |
|
what does this do?
(function($) { /* function body here*/ }) (jQuery); |
It sets $ equal to jQuery, but only in the scope provided.
The purpose is to normalize the $ identifier without affecting the global scope, so that if $.noConflict() has been called, the $ identifier may still be used inside the context of the function. |
|
which characters are removed by $.trim( string )?
|
from the beginning or end of the string only:
\s - space \n - carriage return \r - line feed \f - form feed \t - tab \v - vertical tab \u00A0 - unicode character of some sort |
|
define $.each(container, callback)
|
Iterates items in container and invokes callback for each
container - (Array|Object) to be iterated callback - (Function) first param is index or key from container, second is the value returns the container |
|
how can we break out of iteration while using $.each(container, callback)?
|
return false from callback
|
|
define: $.grep(array, callback, invert)
|
Filters array, using callback to decide whether each value is added to results
array - (Array)values examined callback - (Function)function executed, returns true to add, false to skip; passes current value and index invert - (boolean)flips the callback behavior returns new array with matched elements |
|
define: $.map(array, callback)
|
Iterates array, invokes callback on each item and returns results
array - (Array)values examined callback - (Function)return value is added to results, unless null or undefined; passes current value and index returns new array of callback results |
|
define: $.inArray(value, array)
|
returns index position of first match of value in array
|
|
what is an 'array-like object' in JavaScript?
|
Any object that has a length and the concept of indexed arrays
Example: NodeList, returned by document.getElementsByTagName() |
|
define: $.makeArray( object )
|
Converts array-like object to actual JavaScript array
object - an array-like object, such as a NodeList |
|
define: $.unique(array)
|
returns array of unique elements from array
|
|
define: $.merge(array1, array2)
|
adds values of array2 into array1
|
|
define $.fx.off
|
Enables or disables effects by setting this to true/false
|
|
define: $.extend(deep, target, [src1, src2...])
|
simulate extending object, as in inheritance
deep - if true, deep copy is made target - object to receive new methods src* - the objects that will be inherited |
|
(true or false) When using $.extend(deep, target, source1, source2), if an object exists in both source1 and in target, the one in target overrides source1
|
false, the method/property in target is overwritten, additionally, if it is declared in source2 that would overwrite source1 in turn
|
|
define: $.param(params, traditional)
|
Serializes the passed arguments into URL string
params - (Array|jQuery|Object) can be array of form elements (jQuery wrapped set) traditional - (bool)forces function to serialize like versions of jQuery before 1.4 |
|
what happens if a jQuery wrapped set that doesn't contain form elements is passed to $.param()?
|
the query string shows &undefined=undefined; $.params() does not filter invalid elements
|
|
for $.param(parms), what happens if an element in parms contains an array of key/value pairs? (i.e. how does $.params() handle nested objects?)
|
they are passed to the query string like this:
&address[key1]=value1&address[key2]=value2 |
|
define $.isArray(o)
|
returns true if o is a JS array, but not any other array-like object (like jQuery wrapped sets)
|
|
define $.isEmptyObject(o)
|
returns true if o is JS object with no properties, including ones inherited from prototype
|
|
define $.isFunction(o)
|
returns true if o is a JS function.
|
|
browser built-in methods, like alert() and confirm() are returned as functions by $.isFunction(o)
|
Except in IE ; (
|
|
define $.isPlainObject(o)
|
returns true if o is a JS object created via { } or new Object()
|
|
define $.isXMLDoc(node)
|
returns true if node is an XML document, or a node within an XML document
|
|
define $.noop()
|
It does nothing; used as a placeholder for optional callbacks in arguments
|
|
define $.contains(haystack, needle)
|
determine if DOM element haystack contains DOM element needle
|
|
define $.data(element, name, value)
|
stores or retrieves custom data on DOM elments
element - (Element) DOM elm on which data is stored name - (String) key which value is stored under value - (Object) if provided, sets name to this |
|
define $.removeData(element, name)
|
removes data with key name stored on a DOM element by the $.data() method
|
|
define $.proxy(function, proxy)
|
creates a copy of a function with proxy used as the context (this) when invoked
|
|
define $.proxy(proxy, property)
|
Same as $.proxy(function, proxy) except that the function to be modified is inside of proxy already; property defines the element inside proxy that contains the function.
|
|
define $.parseJSON(json)
|
parses JSON string provided and returns its evaluation (an object)
|
|
why doesn't $.parseJSON() use the browser JSON.parse() function?
|
It does, if it's supported by the browser, otherwise it provides an equivalent trick
|
|
define $.globalEval(code)
|
evaluates passed code in global context (JS eval normally executes in the current context)
|
|
how can a script be dynamically included in the page by jQuery?
|
$.getScript(url,callback)
|
|
for the context, $.getScript(url,callback), define callback
|
callback is a Function executed after the script is loaded ,which receives the text loaded and a status message "success" if it works
|
|
What is special about using $.getScript(...) in older versions of Safari?
|
In Safari 2 and younger, the script definitions loaded don't become available in the callback - not until the script block in which it is loaded relinquishes control back to browser.
|
|
what is the difference between a standards compliant box model and IE box model
|
in IE's box model, margins are included in the element's size (i.e it measures border to border); in standards compliant browsers, they are not (they measure content edge to content edge)
|