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:
-
cat
StringThe category, right now only 'load' is supported
-
name
StringThe number sequence of the test, how it's reported in the URL or config: 1, 2, 3
-
o
ObjectObject containing test properties
-
name
StringThe name of the test
-
test
FunctionThe test function to execute, the only argument to the function is the
Y
instance -
trigger
StringThe 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:
-
cat
StringThe category to execute
-
args
ArrayThe 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:
-
cat
StringThe category of the test to run
-
name
StringThe name of the test to run
-
args
ArrayThe 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