The Dojo/_base/kernel module is the Dojo Foundation module, which contains the most basic features of dojo. When using dojo, you generally do not need to refer to the module directly unless you extend the toolbox to add additional modules to it. Most dojo core modules rely directly or indirectly on the Dojo/_base/kernel module.
1. Methods
Deprecated (Behaviour,extra,removal)
When the Isdebug configuration item is True, the method logs a warning message in the console indicating that a behavior is declared as deprecated.
- Behaviour-string, which is declared an API or behavior that is not approved for use.
- Extra-string, optional, additional information typically points to APIs or behaviors that are similar to APIs or behaviors that are deprecated.
- Removal-string, optionally, indicates that the API or behavior will be removed, usually indicating which version will be removed.
1 <Scripttype= "Text/javascript">2 /*3 * Configure Dojo Parameters4 */5 Dojoconfig= {6 has:{7 //Property Inspection8 "Dojo-firebug":true9 },Ten Parseonload:false, One foo:"Bar", A Async:true, - Isdebug:true - }; the </Script> - <!--Loading Dojo - - <Scripttype= "Text/javascript"src= "/dojo/dojo/dojo/dojo.js"></Script> - <Scripttype= "Text/javascript"> + /* - * Loading Dojo-related modules and making callbacks + */ A require ([ at 'Dojo/_base/kernel' - ],function(kernel) { - kernel.deprecated ("Dijit.layout.SplitContainer","Use Dijit.layout.BorderContainer instead","2.0"); - }); - </Script>
Experimental (Modulename,extra)
When the Isdebug configuration item is True, the method logs a warning message in the console indicating that the method, file, or class is of an experimental nature and has a greater variability.
- Modulename-string, the name of the method, file, or class.
- Extra-string, optional, additional tip information.
1 <Scripttype= "Text/javascript">2 /*3 * Configure Dojo Parameters4 */5 Dojoconfig= {6 has:{7 //Property Inspection8 "Dojo-firebug":true9 },Ten Parseonload:false, One foo:"Bar", A Async:true, - Isdebug:true - }; the </Script> - <!--Loading Dojo - - <Scripttype= "Text/javascript"src= "/dojo/dojo/dojo/dojo.js"></Script> - <Scripttype= "Text/javascript"> + /* - * Loading Dojo-related modules and making callbacks + */ A require ([ at 'Dojo/_base/kernel' - ],function(kernel) { - Kernel.experimental ("Dojo.weather.toKelvin ()","PENDING approval from NOAA"); - }); - </Script>
2. Properties
Locale
Indicates localized information to load the corresponding resource.
1 <Scripttype= "Text/javascript">2 require ([3 'Dojo/_base/kernel'4 ],function(kernel) {5 Console.log (Kernel.locale);6 });7 </Script>
Version
Describes the Dojo version information, which is easily modified and should not be used for feature detection, but should only be used during debugging.
The version number consists of four parts:
- Major-the major version number.
- Minor-minor version number.
- Patch-Fixed version number.
- revision-SVN version number (create this version of SVN version)
1 <Scripttype= "Text/javascript">2 require ([3 'Dojo/_base/kernel'4 ],function(kernel) {5 Console.log (kernel.version);6 Console.log (kernel.version.major);//17 Console.log (kernel.version.minor);//Ten8 Console.log (kernel.version.patch);//49 Console.log (kernel.version.revision);//f4fef70Ten One }); A </Script>
Software version number
- Major-the major version number. Assemblies with the same name but different major version numbers are not interchangeable.
- Minor-minor version number. The major version number is the same but the minor version number differs significantly, with backward compatibility.
- Build-build number. The differences in the build number represent the recompilation of the same source.
- revision-revision number. Assemblies that have the same name, major version number, and minor version number but different revision numbers should be fully interchangeable. This applies to fixing security vulnerabilities in previously released assemblies.
Dojo Kernel-dojo/_base/kernel