Maison > Questions et réponses > le corps du texte
baseUrl
。我本来想在控制台输出下 baseUrl
看看是什么内容的。但是代码报错。(API中描述的,baseUrl
Defined by: dojo/_base/configSpidermonkey
)dojo/_base
的作用和它下面的属性和方法的使用方式?谢谢!<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test _base kernel</title>
</head>
<body>
<h1 id="greeting">Hello</h1>
<script>
var dojoConfig = {
async: true
};
</script>
<script type="text/javascript" src="../dojo/dojo.js"></script>
<script type="text/javascript">
//错误
/*require(['../dojo/_base/kernel.js'], function(kernel){
var currentLocale = kernel.locale;
console.log("currentLocale: ", currentLocale);
});*/
require(['dojo/_base/kernel'], function(kernel){
var currentLocale = kernel.locale;
console.log("currentLocale: ", currentLocale);
});
require([], function(){
console.log("Hello, dojo!");
});
require(['dojo/_base/configSpidermonkey'], function(dojo1){
console.log("dojo: ", dojo1.baseUrl);
});
</script>
</body>
</html>