Features Class
yui3/src/yui/js/features.js:8
Feature detection
Methods
add
-
cat -
name -
o
Add a test to the system
Y.Features.add("load", "1", {});
Parameters:
-
catStringThe category, right now only 'load' is supported
-
nameStringThe number sequence of the test, how it's reported in the URL or config: 1, 2, 3
-
oObjectObject containing test properties
-
nameStringThe name of the test
-
testFunctionThe test function to execute, the only argument to the function is the
Yinstance -
triggerStringThe module that triggers this test.
-
all
-
cat -
args
Execute all tests of a given category and return the serialized results
caps=1:1;2:1;3:0
Parameters:
-
catStringThe category to execute
-
argsArrayThe arguments to pass to the test function
Returns:
A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
test
-
cat -
name -
args
Run a specific test and return a Boolean response.
Y.Features.test("load", "1");
Parameters:
-
catStringThe category of the test to run
-
nameStringThe name of the test to run
-
argsArrayThe arguments to pass to the test function
Returns:
True or false if the test passed/failed.
Properties
tests
Object
Object hash of all registered feature tests