【发布时间】:2011-11-29 22:14:43
【问题描述】:
我正在尝试构建 dojo 1.7 以在我的 phonegap 应用程序中使用。我目前正在使用dojo 1.6.1。我通过转到build.dojotoolkit.org 并选择 dojox.mobile 下的所有内容以及 dojo.store.JsonRest 模块来构建我当前的 dojo.js 文件。效果很好。
我的问题是尝试创建一个配置文件来创建一个类似于我从 dojo 构建网站获得的构建。
我下载了dojo 1.7 stable release src。 我从命令行进入 buildScripts 文件夹并尝试使用以下命令运行构建:
>build profile=path/myMobileProfile.js action=release releaseName=test
我使用了配置文件文件夹中的示例配置文件:
dependencies = {
stripConsole: "normal",
layers: [
{
name: "dojo.js",
customBase: true,
dependencies: [
"dojox.mobile.parser",
"dojox.mobile",
"dojox.mobile.compat"
]
},
{
name: "../dojox/mobile/_compat.js",
layerDependencies: [
"dojo.js"
],
dependencies: [
"dojox.mobile._compat"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
}
它没有错误地构建。然后将构建生成的 dojo.js 放入我的 phonegap 应用程序中。我将我的索引文件更改为以下只是为了测试:
<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="pragma" content="no-cache"/>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojox/mobile/themes/android/android.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" src="libs/dojo/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script type="text/javascript" charset="utf-8" src="phonegap-1.1.0.js"></script>
</head>
<body style="background-color:white">
Phonegap
</body>
</html>
每次我运行应用程序时,我都会得到一个白页。当我用我的工作副本替换 dojo.js 文件时,我看到了 Phonegap 输出。
我希望能够使用 dojo 1.7 mobile 和一些新功能,例如 SpinWheel。
有人可以帮我构建吗?
谢谢
【问题讨论】:
-
我猜这是因为
customBase遗漏了一些重要的东西。从您的个人资料中删除 dojo 层,看看会发生什么(现在)。另外,您的白页上是否收到任何错误消息? -
感谢您的回复。我删除了 custombase 属性并再次尝试。我收到以下错误:TypeError: Result of expression '_1fe' [undefined] is not an object at dojo.js:15
标签: javascript mobile dojo cordova