执行下面的代码时,我在>> logcat中收到multipleDefine脚本错误。它指向第21行 - “APP_DISPLAY_NAME”:“btnClickLoad”,
LogCat错误 - [信息控制台]“错误:mulitpleDefine”
可能的原因是什么,我应该修理它
<!DOCTYPE HTML><html>
<head>
<meta charset="UTF-8">
<title>btnClickLoad</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<!--
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
-->
<link href="worklight/worklight.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<script>
// Define WL namespace.
var WL = WL ? WL : {};
/**
* WLClient configuration variables.
* Values are injected by the deployer that packs the gadget.
*/
WL.StaticAppProps = {
"APP_DISPLAY_NAME": "btnClickLoad",
"APP_ID": "btnClickLoad",
"APP_SERVICES_URL": "\/apps\/services\/",
"APP_VERSION": "1.0",
"ENVIRONMENT": "android",
"LOGIN_DISPLAY_TYPE": "embedded",
"WORKLIGHT_NATIVE_VERSION": "3024537711",
"WORKLIGHT_PLATFORM_VERSION": "6.3.0.0",
"WORKLIGHT_ROOT_URL": "\/apps\/services\/api\/btnClickLoad\/android\/"
};
</script>
<script src="worklight/cordova.js"></script>
<script src="worklight/wljq.js"></script>
<script src="worklight/worklight.js"></script>
<script src="worklight/checksum.js"></script>
<script>window.$ = window.jQuery = WLJQ;</script>
<script src="dojox/mobile/deviceTheme.js" type="text/javascript"></script>
<script data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src="http://10.97.62.72:9988/dojo10/btnClickLoad/btnClickLoad/android/dojo/dojo.js" type="text/javascript"></script>
<!-- Add -->
<link href="dojox/mobile/themes/iphone/iphone.css" rel="stylesheet">
<script type="text/javascript" src="dojox/mobile/deviceTheme.js"
data-dojo-config="mblThemeFiles: ['base','Button']"></script>
<script type="text/javascript">
require([
"dijit/registry",
"dojox/mobile/ViewController",
"dojox/mobile/parser",
"dojox/mobile",
"dojox/mobile/Button",
"dojox/mobile/View",
"dojox/mobile/Button",
"dojox/mobile/Heading",
"dojox.mobile.ScrollableView",
], function(registry, ViewController){
var vc = ViewController.getInstance();
onBtn1Clicked = function(e){
// the external view is loaded under the "container" view.
vc.openExternalView({
url:"load.html",
transition:"slide"
}, registry.byId("container").containerNode);
};
});
</script>
<!-- end -->
</head>
<body style="display: none;">
<div data-dojo-props="selected:true" data-dojo-type="dojox.mobile.ScrollableView" id="view0">
<!--application UI goes here-->
Hello MobileFirst
<div id="home" data-dojo-type="dojox.mobile.View">
<h1 data-dojo-type="dojox.mobile.Heading">Home</h1>
<button data-dojo-type="dojox.mobile.Button" id="btn1" style="margin:5px;"
data-dojo-props='onClick:onBtn1Clicked'>Load external view</button>
</div>
<div id="container" data-dojo-type="dojox.mobile.View">
<!-- An external view is loaded here when clicking the button above -->
</div>
</div>
<script src="js/initOptions.js"></script>
<script src="js/main.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
答案 0 :(得分:0)
您正在加载dojox / mobile / deviceTheme.js两次,如果删除第一个,它应该解决问题。
<script src="dojox/mobile/deviceTheme.js" type="text/javascript"></script>