RequestUtils Class
Utilities that assist with parsing load items, and determining file types, etc.
Item Index
Methods
- getTypeByExtension static
- isBinary static
- isText static
Methods
getTypeByExtension
-
extension
Determine the type of the object using common extensions. Note that the type can be passed in with the load item if it is an unusual extension.
Parameters:
-
extension
StringThe file extension to use to determine the load type.
Returns:
The determined load type (for example, createjs.Types.IMAGE
). Will return null
if
the type can not be determined by the extension.
isBinary
-
type
Determine if a specific type should be loaded as a binary file. Currently, only images and items marked specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play back using an audio tag if it is loaded as binary. Plugins can change the item type to binary to ensure they get a binary result to work with. Binary files are loaded using XHR2. Types are defined as static constants on AbstractLoader.
Parameters:
-
type
StringThe item type.
Returns:
If the specified type is binary.